Attach sidebar-close handler to current-page links

Adjusts the CSS selector query used within the Sphinx-ReadTheDocs-Theme when deciding what HTML elements in the DOM should, when clicked, auto-close the sidebar menu if it is open. During Sphinx singlehtml builds, the current CSS class is not added to hyperlinks, so instead here we check for hyperlinks that start with the URI fragment identifier indicator (#). This should be most, but not quite all, hyperlinks on singlehtml web pages. This should select all of the sidebar menu hyperlinks on singlehtml web pages.

It could be a long duration of time before this patch is accepted -- if it is at all -- by upstream, because it depends on Sphinx v8.1 onwards - and that is more recent than the supported Sphinx version window of upstream. However, it could be used to assist with usability of some single-page HTML documentation within Debian.

Closes #1075914.

Edited by James Addison

Merge request reports

Loading