Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ and then by tagging the cells you want to strip with the tag `jupyterlite_sphinx
of the cell, like this:

```json
{
"metadata": {
"tags": [
"jupyterlite_sphinx_strip": "true"
"jupyterlite_sphinx_strip"
]
}
```
Expand All @@ -89,7 +89,7 @@ in the JupyterLite console:
"cell_type": "markdown",
"metadata": {
"tags": [
"jupyterlite_sphinx_strip": "true"
"jupyterlite_sphinx_strip"
]
},
"source": [
Expand Down
4 changes: 1 addition & 3 deletions jupyterlite_sphinx/jupyterlite_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,11 @@ def run(self):
# is so that we don't end up removing useful data or directives that
# are not meant to be removed.

nb = nbformat.read(notebook, as_version=4)
print(f"Opened {notebook_name}")
nb = nbformat.read(notebook, as_version=4)
nb.cells = [
cell
for cell in nb.cells
if "true" not in cell.metadata.get("jupyterlite_sphinx_strip", [])
if "jupyterlite_sphinx_strip" not in cell.metadata.get("tags", [])
]
nbformat.write(nb, notebooks_dir, version=4)

Expand Down