-
Notifications
You must be signed in to change notification settings - Fork 1
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
Option toc_hover=False raises Theme error #35
Comments
Hey @lneuhaus, I'm having some trouble reproducing this issue on my end. Do you mind sharing a relevant snippet from your |
Here is the relevant code: xanadu-sphinx-theme/xanadu_sphinx_theme/header.html Lines 43 to 50 in dc85686
@lneuhaus has found an edge case/bug where But this can also be fixed by adding in {% set dropdown_link = [] %} above line 43 |
That's interesting - I was trying to build the Xanadu Sphinx Theme docs locally with html_theme_options = {
# ...
"navbar_left_links": [],
# ...
"toc_global": False,
"toc_hover": True,
# ...
} to reproduce the issue but the build succeeded $ grep -E "toc_(g|h)|left" doc/conf.py
"navbar_left_links": [],
"toc_global": False,
"toc_hover": True,
$ make docs
make -C doc html
Running Sphinx v4.5.0
making output directory... done
[autosummary] generating autosummary for: code.rst, configuration.rst, directives.rst, elements.rst, gallery.rst, gallery/index.rst, gallery/sg_execution_times.rst, gallery/tutorial_demo.rst, index.rst, release_notes.rst, started.rst
[autosummary] generating autosummary for: /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.rst
[autosummary] generating autosummary for: /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.BioDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.CommunityCardDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.DetailsDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.GalleryItemDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.IndexCardDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.Path.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.RelatedDemoDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.TitleCardDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.YouTubeVideoDirective.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.files.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.setup.rst, /Users/mikhail/ro/xanadu-sphinx-theme/doc/api/xanadu_sphinx_theme.templates_dir.rst
generating gallery...
WARNING: 'pypandoc' not available. Using Sphinx-Gallery to convert rst text blocks to markdown for .ipynb files.
generating gallery for gallery... [100%] tutorial_demo.py
computation time summary:
- tutorials/tutorial_demo.py: 0.00 sec 0.0 MB
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 11 source files that are out of date
updating environment: [new config] 24 added, 0 changed, 0 removed
reading sources... [100%] started
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] started
generating indices... genindex py-modindex done
highlighting module code... [100%] xanadu_sphinx_theme.directives.youtube_video
writing additional pages... search done
copying images... [100%] gallery/images/thumb/sphx_glr_tutorial_demo_thumb.png
copying downloadable files... [100%] gallery/tutorial_demo.ipynb
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 1 warning.
The HTML pages are in _build/html.
Sphinx-Gallery successfully executed 0 out of 0 files subselected by:
gallery_conf["filename_pattern"] = 'tutorial'
gallery_conf["ignore_pattern"] = '__init__\\.py'
after excluding 1 file that had previously been run (based on MD5).
embedding documentation hyperlinks...
embedding documentation hyperlinks for gallery... [100%] tutorial_demo.html |
Oh weird - maybe different versions of Jinja? Only thing I can think of 🤔 |
Could be! Here are my packages: $ pip list
Package Version Editable project location
----------------------------- ----------- -------------------------------------
alabaster 0.7.12
astroid 2.11.7
Babel 2.10.3
black 22.3.0
build 0.7.0
certifi 2022.6.15.1
charset-normalizer 2.1.1
click 8.1.3
colorama 0.4.6
cycler 0.11.0
dill 0.3.6
docutils 0.17.1
fonttools 4.37.1
idna 3.3
imagesize 1.4.1
importlib-metadata 4.12.0
importlib-resources 5.9.0
isort 5.10.1
Jinja2 3.1.2
kiwisolver 1.4.4
lazy-object-proxy 1.9.0
m2r2 0.3.2
MarkupSafe 2.1.1
matplotlib 3.5.3
mccabe 0.7.0
mistune 0.8.4
mypy-extensions 0.4.3
numpy 1.23.3
packaging 21.3
pathspec 0.10.3
pep517 0.13.0
Pillow 9.3.0
pip 22.3.1
platformdirs 2.6.2
Pygments 2.13.0
pylint 2.13.7
pyparsing 3.0.9
python-dateutil 2.8.2
pytz 2022.2.1
requests 2.28.1
setuptools 58.1.0
six 1.16.0
snowballstemmer 2.2.0
Sphinx 4.5.0
sphinx-copybutton 0.5.0
sphinx-gallery 0.10.1
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
tomli 2.0.1
typing_extensions 4.4.0
urllib3 1.26.12
wheel 0.38.1
wrapt 1.14.1
xanadu-sphinx-theme 0.3.6 /Users/mikhail/ro/xanadu-sphinx-theme
zipp 3.8.1 |
I was definitely using an older jinja version:
But I tried to reproduce the issue with a clone of this repo in the |
Maybe best to blame this on a broken environment on my end and not change the code. |
@lneuhaus, do you mind upgrading Jinja2 to the latest version in your repository and checking if the error still happens? |
I tried this with In case you're curious about the nbsphinx issue:
|
For reference spatialaudio/nbsphinx#710 |
jupyter/nbconvert#1742 (comment). I think we can close this, unless you want to be explicit in pinning the Jinja2 version dependency here. |
Thanks for the investigation, @lneuhaus! I think the best course of action is to define |
This issue has been fixed in v0.3.7 of the Xanadu Sphinx Theme. |
When I use this theme with
toc_hover=False
, I get the following errorSearching for
dropdown_link
in this repo shows that this variable is only conditionally defined in the template.The text was updated successfully, but these errors were encountered: