jbms / sphinx-immaterial

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system
https://jbms.github.io/sphinx-immaterial/
Other
177 stars 28 forks source link

Extension error (sphinx_immaterial.nav_adapt) in synopses #355

Closed sdebionne closed 6 days ago

sdebionne commented 1 week ago

when building my project, switching from the readthedocs theme (clean build directory), I get:

Extension error (sphinx_immaterial.nav_adapt):
Handler <function _html_page_context at 0x7f7e5b0dfc10> for event 'html-page-context' threw an exception (exception: 'synopses')

Running with -P:

  File "/home/debionne/miniconda3/envs/sphinx/lib/python3.9/site-packages/sphinx_immaterial/nav_adapt.py", line 434, in _add_domain_info_to_toc
    m = _get_domain_anchor_map(app)
  File "/home/debionne/miniconda3/envs/sphinx/lib/python3.9/site-packages/sphinx_immaterial/nav_adapt.py", line 426, in _get_domain_anchor_map
    m = _make_domain_anchor_map(env)
  File "/home/debionne/miniconda3/envs/sphinx/lib/python3.9/site-packages/sphinx_immaterial/nav_adapt.py", line 391, in _make_domain_anchor_map
    for key, synopsis in get_object_synopses():
  File "/home/debionne/miniconda3/envs/sphinx/lib/python3.9/site-packages/sphinx_immaterial/apidoc/python/synopses.py", line 138, in get_object_synopses
    synopses = self.data["synopses"]
KeyError: 'synopses'
> /home/me/miniconda3/envs/sphinx/lib/python3.9/site-packages/sphinx_immaterial/apidoc/python/synopses.py(138)get_object_synopses()
-> synopses = self.data["synopses"]
(Pdb) p self.data
{'objects': {}, 'modules': {}, 'version': 0}

with

sphinx                    6.2.1              pyhd8ed1ab_0    conda-forge
sphinx-immaterial         0.11.12            pyhd8ed1ab_0    conda-forge
myst-parser               3.0.1              pyhd8ed1ab_0    conda-forge
2bndy5 commented 1 week ago

Did you add sphinx_immaterial to your list of extensions in conf.py?

91Seconds commented 1 week ago

This is the error I got that I mentioned in #354 . For me the problem was that I had extension = ['sphinx_immaterial'] instead of extensions = ['sphinx_immaterial']

sdebionne commented 6 days ago

I can believe I made such a stupid mistake (the error message is not helping). Thank you very much!