diff --git a/docs/execute-notebooks.md b/docs/execute-notebooks.md index 2d3879ff0..49cd173c6 100644 --- a/docs/execute-notebooks.md +++ b/docs/execute-notebooks.md @@ -43,7 +43,7 @@ Here's an example of adding this tag with a {myst:directive}`code-cell` directiv ````markdown ```{code-cell} -:tags: raises-exception +:tag: raises-exception print("Hello" + 10001) ``` @@ -57,7 +57,7 @@ For [Markdown notebooks using the {myst:directive}`code-cell` directive](noteboo ````markdown ```{code-cell} -:tags: skip-execution +:tag: skip-execution name = input("What is your name?") ``` diff --git a/docs/notebook-configuration.md b/docs/notebook-configuration.md index ce9529416..58986db5d 100644 --- a/docs/notebook-configuration.md +++ b/docs/notebook-configuration.md @@ -27,11 +27,22 @@ In Markdown of a jupyter notebook these look like: ````markdown ```{code-cell} python -:tags: remove-input +:tag: remove-input print("This will show output with no input!") ``` ```` +for a single tag, or + +````markdown +```{code-cell} python +:tags: [my-tag1, my-tag2] +print("This will show output with no input!") +``` +```` + +for any number of tags. + :::{table} Notebook cell tags with special meanings :label: tbl:notebook-cell-tags diff --git a/docs/notebooks-with-markdown.md b/docs/notebooks-with-markdown.md index 08e6e52d4..674c7cf63 100644 --- a/docs/notebooks-with-markdown.md +++ b/docs/notebooks-with-markdown.md @@ -116,7 +116,7 @@ For example, the following code defines a `remove-input` tag (See all [notebook ````markdown ```{code-cell} python -:tags: remove-input +:tag: remove-input print("This will show output with no input!") ``` ```` @@ -124,14 +124,14 @@ print("This will show output with no input!") and results in the following: > ```{code-cell} python -> :tags: remove-input +> :tag: remove-input > print("This will show output with no input!") > ``` This can be particularly helpful for showing the output of a calculation or plot, which is reproducible in the {download}`source code <./notebooks-with-markdown.md>`, but not shown to the user like this `matplotlib` plot: ```{code-cell} python -:tags: remove-input +:tag: remove-input # Data for plotting t = np.arange(0.0, 2.0, 0.01) s = 1 + np.sin(2 * np.pi * t) @@ -149,12 +149,12 @@ plt.show() For **multiple tags** you have two ways to provide them: -- If you specify argument options with `:`, tags will be parsed as a comma-separated string. +- If you specify argument options with `:`, tags will be parsed as a comma-separated list of strings. For example: ````markdown ```{code-cell} python - :tags: tag1, tag2,tag3 + :tags: [tag1, tag2,tag3] # Note that whitespace is removed from tags! print("howdy!") ```