Skip to content

Commit

Permalink
Check for tags and widgets to appease the new Jinja2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Jun 1, 2021
1 parent 4c929a6 commit 4c5cc40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
python_requires='>=3.6',
install_requires=[
'docutils',
'jinja2~=2.11',
'jinja2',
'nbconvert!=5.4',
'traitlets',
'nbformat',
Expand Down
6 changes: 3 additions & 3 deletions src/nbsphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@
{% block markdowncell %}
{%- if 'nbsphinx-gallery' in cell.metadata
or 'nbsphinx-gallery' in cell.metadata.tags
or 'nbsphinx-gallery' in cell.metadata.get('tags', [])
or 'nbsphinx-toctree' in cell.metadata
or 'nbsphinx-toctree' in cell.metadata.tags %}
or 'nbsphinx-toctree' in cell.metadata.get('tags', []) %}
{{ cell | extract_gallery_or_toctree }}
{%- else %}
{{ cell | save_attachments or super() | replace_attachments }}
Expand Down Expand Up @@ -279,7 +279,7 @@
{% block footer %}
{% if 'application/vnd.jupyter.widget-state+json' in nb.metadata.widgets %}
{% if 'application/vnd.jupyter.widget-state+json' in nb.metadata.get('widgets', {})%}
.. raw:: html
Expand Down

0 comments on commit 4c5cc40

Please sign in to comment.