Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdhk committed May 27, 2024
0 parents commit 2addaef
Show file tree
Hide file tree
Showing 196 changed files with 35,872 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 8bb02137e233f38a2bceadbf36f9c8f1
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
11 changes: 11 additions & 0 deletions _sources/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Welcome to your Jupyter Book

This is a small sample book to give you a feel for how book content is
structured.
It shows off a few of the major file types, as well as some sample content.
It does not go in-depth into any particular topic - check out [the Jupyter Book documentation](https://jupyterbook.org) for more information.

Check out the content pages bundled with this sample book to see more.

```{tableofcontents}
```
85 changes: 85 additions & 0 deletions _sources/markdown-notebooks.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "88b5e405",
"metadata": {},
"source": [
"# Notebooks with MyST Markdown\n",
"\n",
"Jupyter Book also lets you write text-based notebooks using MyST Markdown.\n",
"See [the Notebooks with MyST Markdown documentation](https://jupyterbook.org/file-types/myst-notebooks.html) for more detailed instructions.\n",
"This page shows off a notebook written in MyST Markdown.\n",
"\n",
"## An example cell\n",
"\n",
"With MyST Markdown, you can define code cells with a directive like so:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ae813372",
"metadata": {},
"outputs": [],
"source": [
"print(2 + 2)"
]
},
{
"cell_type": "markdown",
"id": "26ba2a70",
"metadata": {},
"source": [
"When your book is built, the contents of any `{code-cell}` blocks will be\n",
"executed with your default Jupyter kernel, and their outputs will be displayed\n",
"in-line with the rest of your content.\n",
"\n",
"```{seealso}\n",
"Jupyter Book uses [Jupytext](https://jupytext.readthedocs.io/en/latest/) to convert text-based files to notebooks, and can support [many other text-based notebook files](https://jupyterbook.org/file-types/jupytext.html).\n",
"```\n",
"\n",
"## Create a notebook with MyST Markdown\n",
"\n",
"MyST Markdown notebooks are defined by two things:\n",
"\n",
"1. YAML metadata that is needed to understand if / how it should convert text files to notebooks (including information about the kernel needed).\n",
" See the YAML at the top of this page for example.\n",
"2. The presence of `{code-cell}` directives, which will be executed with your book.\n",
"\n",
"That's all that is needed to get started!\n",
"\n",
"## Quickly add YAML metadata for MyST Notebooks\n",
"\n",
"If you have a markdown file and you'd like to quickly add YAML metadata to it, so that Jupyter Book will treat it as a MyST Markdown Notebook, run the following command:\n",
"\n",
"```\n",
"jupyter-book myst init path/to/markdownfile.md\n",
"```"
]
}
],
"metadata": {
"jupytext": {
"formats": "md:myst",
"text_representation": {
"extension": ".md",
"format_name": "myst",
"format_version": 0.13,
"jupytext_version": "1.11.5"
}
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"source_map": [
13,
25,
27
]
},
"nbformat": 4,
"nbformat_minor": 5
}
53 changes: 53 additions & 0 deletions _sources/markdown-notebooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.11.5
kernelspec:
display_name: Python 3
language: python
name: python3
---

# Notebooks with MyST Markdown

Jupyter Book also lets you write text-based notebooks using MyST Markdown.
See [the Notebooks with MyST Markdown documentation](https://jupyterbook.org/file-types/myst-notebooks.html) for more detailed instructions.
This page shows off a notebook written in MyST Markdown.

## An example cell

With MyST Markdown, you can define code cells with a directive like so:

```{code-cell}
print(2 + 2)
```

When your book is built, the contents of any `{code-cell}` blocks will be
executed with your default Jupyter kernel, and their outputs will be displayed
in-line with the rest of your content.

```{seealso}
Jupyter Book uses [Jupytext](https://jupytext.readthedocs.io/en/latest/) to convert text-based files to notebooks, and can support [many other text-based notebook files](https://jupyterbook.org/file-types/jupytext.html).
```

## Create a notebook with MyST Markdown

MyST Markdown notebooks are defined by two things:

1. YAML metadata that is needed to understand if / how it should convert text files to notebooks (including information about the kernel needed).
See the YAML at the top of this page for example.
2. The presence of `{code-cell}` directives, which will be executed with your book.

That's all that is needed to get started!

## Quickly add YAML metadata for MyST Notebooks

If you have a markdown file and you'd like to quickly add YAML metadata to it, so that Jupyter Book will treat it as a MyST Markdown Notebook, run the following command:

```
jupyter-book myst init path/to/markdownfile.md
```
55 changes: 55 additions & 0 deletions _sources/markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Markdown Files

Whether you write your book's content in Jupyter Notebooks (`.ipynb`) or
in regular markdown files (`.md`), you'll write in the same flavor of markdown
called **MyST Markdown**.
This is a simple file to help you get started and show off some syntax.

## What is MyST?

MyST stands for "Markedly Structured Text". It
is a slight variation on a flavor of markdown called "CommonMark" markdown,
with small syntax extensions to allow you to write **roles** and **directives**
in the Sphinx ecosystem.

For more about MyST, see [the MyST Markdown Overview](https://jupyterbook.org/content/myst.html).

## Sample Roles and Directives

Roles and directives are two of the most powerful tools in Jupyter Book. They
are like functions, but written in a markup language. They both
serve a similar purpose, but **roles are written in one line**, whereas
**directives span many lines**. They both accept different kinds of inputs,
and what they do with those inputs depends on the specific role or directive
that is being called.

Here is a "note" directive:

```{note}
Here is a note
```

It will be rendered in a special box when you build your book.

Here is an inline directive to refer to a document: {doc}`markdown-notebooks`.


## Citations

You can also cite references that are stored in a `bibtex` file. For example,
the following syntax: `` {cite}`holdgraf_evidence_2014` `` will render like
this: {cite}`holdgraf_evidence_2014`.

Moreover, you can insert a bibliography into your page with this syntax:
The `{bibliography}` directive must be used for all the `{cite}` roles to
render properly.
For example, if the references for your book are stored in `references.bib`,
then the bibliography is inserted with:

```{bibliography}
```

## Learn more

This is just a simple starter to get you started.
You can learn a lot more at [jupyterbook.org](https://jupyterbook.org).
3 changes: 3 additions & 0 deletions _sources/mechinterp/mechinterp_intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Mechanistic Interpretability

Welcome to the Mechanistic Interpretability workshop!
Loading

0 comments on commit 2addaef

Please sign in to comment.