Skip To Article

In Jupyter Notebooks you can add cell level configuration by specifying tags in the cell metadata. There are also global controls in the project settings.

Notebook Cell Tags

Tags are a list of strings under the tags key in the cell metadata, which can be set in JupyterLab, VSCode or in a {code-cell} directive.

In the JSON representation of a jupyter notebook these look like:

{
  "cell_type": "code",
  "source": ["print('hello world')"],
  "metadata": {
    "tags": ["my-tag1", "my-tag2"]
  }
}

In Markdown of a jupyter notebook these look like:

```{code-cell} python
:tags: remove-input
print("This will show output with no input!")
```

Table 1:Notebook cell tags with special meanings

TagDescription
remove-cellRemove the cell from the rendered output.
remove-inputRemove the code cell input/source from the rendered output.
remove-outputRemove the code cell output from the rendered output.
hide-cellHides the cell from the rendered output.
hide-inputHides the code cell input/source from the rendered output.
hide-outputHides the code cell output from the rendered output.
remove-stderrRemove the code cell output stderr from the rendered output. See also project config
remove-stdoutRemove the code cell output stdout from the rendered output. See also project config
skip-executionSkip this cell, when executing the notebook
raises-exceptionExpect the code cell to raise an Exception (and continue execution)
MyST MarkdownMyST Markdown
Community-driven tools for the future of technical communication and publication, part of Jupyter.