Skip to content
Open
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
11 changes: 11 additions & 0 deletions doc/hidden-cells.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@
"source": [
"This is the cell after the hidden cell."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also remove just the cell input from the HTML/LaTeX output by adding this to the cell metadata:\n",
"\n",
"```\n",
"\"nbsphinx\": \"hidden-input\"\n",
"```"
]
}
],
"metadata": {
Expand Down
2 changes: 2 additions & 0 deletions src/nbsphinx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@


{% block input -%}
{%- if cell.metadata.nbsphinx != 'hidden-input' %}
.. nbinput:: {% if cell.metadata.magics_language -%}
{{ cell.metadata.magics_language }}
{%- elif nb.metadata.language_info -%}
Expand All @@ -141,6 +142,7 @@
{%- endif %}

{{ cell.source.strip('\n') | indent }}
{%- endif %}
{% endblock input %}


Expand Down