diff --git a/setup.py b/setup.py index bc26c64b..81a1b06c 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ python_requires='>=3.6', install_requires=[ 'docutils', - 'jinja2~=2.11', + 'jinja2', 'nbconvert!=5.4', 'traitlets', 'nbformat', diff --git a/src/nbsphinx.py b/src/nbsphinx.py index 8b02f20a..9374ac9b 100644 --- a/src/nbsphinx.py +++ b/src/nbsphinx.py @@ -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 }} @@ -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