-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🙈 Notebook Cell Tags Documentation #1750
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7837f4d
🙈 Notebook Cell Tags Documentation
rowanc1 56c7ece
Use NotebookCellTags for raises-exception and skip-execution
rowanc1 08603cf
changeset
rowanc1 5b376a1
Hide hidden outputs/code/blocks for static exports
rowanc1 e3bc979
changeset
rowanc1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"myst-execute": patch | ||
"myst-common": patch | ||
--- | ||
|
||
Use NotebookCellTags for raises-exception and skip-execution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"myst-to-typst": patch | ||
"myst-to-docx": patch | ||
"myst-to-jats": patch | ||
"myst-to-tex": patch | ||
"myst-to-md": patch | ||
--- | ||
|
||
Update static exports to hide hidden code cells and blocks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: Notebook Configuration | ||
--- | ||
|
||
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](#project-settings). | ||
|
||
(notebook-cell-tags)= | ||
|
||
### 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 {myst:directive}`code-cell` directive. | ||
|
||
In the JSON representation of a jupyter notebook these look like: | ||
|
||
```json | ||
{ | ||
"cell_type": "code", | ||
"source": ["print('hello world')"], | ||
"metadata": { | ||
"tags": ["my-tag1", "my-tag2"] | ||
} | ||
} | ||
``` | ||
|
||
In Markdown of a jupyter notebook these look like: | ||
|
||
````markdown | ||
```{code-cell} python | ||
:tags: remove-input | ||
print("This will show output with no input!") | ||
``` | ||
```` | ||
|
||
:::{table} Notebook cell tags with special meanings | ||
:label: tbl:notebook-cell-tags | ||
|
||
| Tag | Description | | ||
| ------------------ | -------------------------------------------------------------------------------------------------------------- | | ||
| `remove-cell` | Remove the cell from the rendered output. | | ||
| `remove-input` | Remove the code cell input/source from the rendered output. | | ||
| `remove-output` | Remove the code cell output from the rendered output. | | ||
| `hide-cell` | Hides the cell from the rendered output. | | ||
| `hide-input` | Hides the code cell input/source from the rendered output. | | ||
| `hide-output` | Hides the code cell output from the rendered output. | | ||
| `remove-stderr` | Remove the code cell output stderr from the rendered output. See also [project config](#setting:output_stderr) | | ||
| `remove-stdout` | Remove the code cell output stdout from the rendered output. See also [project config](#setting:output_stdout) | | ||
| `skip-execution` | Skip this cell, when executing the notebook | | ||
| `raises-exception` | Expect the code cell to raise an Exception (and continue execution) | | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small little improvements. I was in there looking to implement this and was surprised it was already done!