python / python-docs-theme

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

Update ``python-docs-theme`` to work with Sphinx 5 & 6 #99

Closed AA-Turner closed 1 year ago

AA-Turner commented 1 year ago

Updated remaining jQuery scripts to standard JavaScript, and a few fixes for CSS changes.

A

AA-Turner commented 1 year ago

Turns out this is required for Sphinx 5... https://github.com/python/cpython/pull/99381

A

hugovk commented 1 year ago

Is this ready to merge?

hugovk commented 1 year ago

Rebased on main to build RTD preview:

And there's an error in the console:

sidebar.js:34 Uncaught TypeError: Cannot read properties of null (reading 'querySelector')
    at HTMLDocument.initialiseSidebar (sidebar.js:34:38)

From the last line of:

  const bodyWrapper = document.getElementsByClassName("bodywrapper")[0]
  const sidebar = document.getElementsByClassName("sphinxsidebar")[0]
  const sidebarWrapper = document.getElementsByClassName('sphinxsidebarwrapper')[0]
  const sidebarButton = document.getElementById("sidebarbutton")
  const sidebarArrow = sidebarButton.querySelector('span')
AA-Turner commented 1 year ago

Updated the JavaScript, the previous version was attempting to access an element that had yet to be created. Thank you for the review!

A

JulienPalard commented 1 year ago

I just built https://docs.python.org/3.12/ after merging this PR.

AA-Turner commented 1 year ago

I just built docs.python.org/3.12 after merging this PR.

Working for me in Firefox 112 on Windows! If you have time over the next few weeks, please would we be able to make a 2023.4 release, to unblock https://github.com/python/cpython/pull/99381?

A

JulienPalard commented 1 year ago

Releasing: https://github.com/python/python-docs-theme/pull/126