python / python-docs-theme

Sphinx theme for Python documentation
Other
75 stars 58 forks source link

Don't duplicate the sidebar button on Sphinx 5 and newer #127

Closed AA-Turner closed 1 year ago

AA-Turner commented 1 year ago

The sidebar button is included in the generated HTML from Sphinx 5 onwards (specifically, from https://github.com/sphinx-doc/sphinx/commit/3b01fbe2adf3077cad5c2cf345c6d000d429d7ac and the changes to themes/classic/layout.html).

We use the sphinx_version_tuple templating variable addded in Sphinx 4.2 to determine if we should add the sidebar button dynamically via JavaScript, or load the pre-existing button element from HTML.

I have tested locally on Sphinx 6.1.3, Sphinx 3.2.0, and Sphinx 4.5.0--all three display correct behaviour with respect to the sidebar.

A

AA-Turner commented 1 year ago

I've updated https://github.com/python/cpython/pull/99381 to point to this PR, so that it installs Sphinx 6.1.3 and python-docs-theme as of this PR. The deploy preview seems to show that all is working as intended on newer Sphinx versions, and this PR's RTD preview shows it working on older Sphinx versions.

A

AA-Turner commented 1 year ago

Thanks Hugo!

A