executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
441 stars 201 forks source link

Autosummary and templates not working with versions > 1 #729

Open sequoiap opened 1 year ago

sequoiap commented 1 year ago

Describe the bug

context Try to build the documentation using autosummary and template overrides to give methods their own pages. Using the same templates as the numpy documentation.

expectation I expected the docs to build properly, each function getting its own page.

bug But instead the docs fail to build.

Here's the first error message:

$ jb build docs
Extension error (pydata_sphinx_theme):
Handler <function update_and_remove_templates at 0x109cf9ee0> for event 'html-page-context' threw an exception (exception: toggle-primary-sidebar.html)

problem There is therefore no good way to generate API docs with the latest theme with the nice new searchbar shortcuts and other features. This seems to have come up before:

As mentioned, older versions work fine, but I want this version to work.

Reproduce the bug

  1. Clone the sample repository: https://github.com/sequoiap/bookerrors
  2. Create a virtual environment: python3 -m venv env
  3. Activate the virtual environment: source env/bin/activate
  4. Install the project to that virtual environment: pip install -e .
  5. Build the docs: jb build docs
  6. Bask in the glory of the error message in the terminal.

List your environment

Jupyter Book      : 0.15.1
External ToC      : 0.3.1
MyST-Parser       : 0.18.1
MyST-NB           : 0.17.2
Sphinx Book Theme : 1.0.1
Jupyter-Cache     : 0.6.1
NbClient          : 0.7.4
Sphinx            : 5.3.0
welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

TomaSusi commented 1 year ago

I confirm this error. Downgrading is not a great solution, so a fix would be very much appreciated!

adam-grant-hendry commented 1 year ago

See the root cause analysis in pydata-sphinx-theme #1511 and the corresponding fix in sphinx-book-theme PR #770.