You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Jupyter Book also lets you write text-based notebooks using MyST Markdown.\n",
11
+
"See [the Notebooks with MyST Markdown documentation](https://jupyterbook.org/file-types/myst-notebooks.html) for more detailed instructions.\n",
12
+
"This page shows off a notebook written in MyST Markdown.\n",
13
+
"\n",
14
+
"## An example cell\n",
15
+
"\n",
16
+
"With MyST Markdown, you can define code cells with a directive like so:"
17
+
]
18
+
},
19
+
{
20
+
"cell_type": "code",
21
+
"execution_count": 1,
22
+
"id": "a6cdc73c",
23
+
"metadata": {},
24
+
"outputs": [
25
+
{
26
+
"name": "stdout",
27
+
"output_type": "stream",
28
+
"text": [
29
+
"4\n"
30
+
]
31
+
}
32
+
],
33
+
"source": [
34
+
"print(2 + 2)"
35
+
]
36
+
},
37
+
{
38
+
"cell_type": "markdown",
39
+
"id": "f5367020",
40
+
"metadata": {},
41
+
"source": [
42
+
"When your book is built, the contents of any `{code-cell}` blocks will be\n",
43
+
"executed with your default Jupyter kernel, and their outputs will be displayed\n",
44
+
"in-line with the rest of your content.\n",
45
+
"\n",
46
+
"```{seealso}\n",
47
+
"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",
48
+
"```\n",
49
+
"\n",
50
+
"## Create a notebook with MyST Markdown\n",
51
+
"\n",
52
+
"MyST Markdown notebooks are defined by two things:\n",
53
+
"\n",
54
+
"1. YAML metadata that is needed to understand if / how it should convert text files to notebooks (including information about the kernel needed).\n",
55
+
" See the YAML at the top of this page for example.\n",
56
+
"2. The presence of `{code-cell}` directives, which will be executed with your book.\n",
57
+
"\n",
58
+
"That's all that is needed to get started!\n",
59
+
"\n",
60
+
"## Quickly add YAML metadata for MyST Notebooks\n",
61
+
"\n",
62
+
"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",
Jupyter Book also lets you write text-based notebooks using MyST Markdown.
19
+
See [the Notebooks with MyST Markdown documentation](https://jupyterbook.org/file-types/myst-notebooks.html) for more detailed instructions.
20
+
This page shows off a notebook written in MyST Markdown.
21
+
22
+
## An example cell
23
+
24
+
With MyST Markdown, you can define code cells with a directive like so:
25
+
26
+
```{code-cell}
27
+
print(2 + 2)
28
+
```
29
+
30
+
When your book is built, the contents of any `{code-cell}` blocks will be
31
+
executed with your default Jupyter kernel, and their outputs will be displayed
32
+
in-line with the rest of your content.
33
+
34
+
```{seealso}
35
+
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).
36
+
```
37
+
38
+
## Create a notebook with MyST Markdown
39
+
40
+
MyST Markdown notebooks are defined by two things:
41
+
42
+
1. YAML metadata that is needed to understand if / how it should convert text files to notebooks (including information about the kernel needed).
43
+
See the YAML at the top of this page for example.
44
+
2. The presence of `{code-cell}` directives, which will be executed with your book.
45
+
46
+
That's all that is needed to get started!
47
+
48
+
## Quickly add YAML metadata for MyST Notebooks
49
+
50
+
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:
0 commit comments