Control: tags -1 - patch

My patch seemed too simple; I now think it's somewhat flawed, after learning
more about what is going on here.

On Wed, 10 Jul 2024 at 23:52, James Addison <j...@jp-hosting.net> wrote:
> [ ... snip ... ]
>
> In my opinion we should try to get this into src:sphinx-rtd-theme as a Debian
> patch, and also to try to send it upstream.

Let's *not* do this yet (explanation follows).

I was trying to figure out the logic of the original CSS query: why only add
the close-menu event handler to 'current' links in the (multi)HTML build?  I
think the explanation is that those are -- surprise surprise -- links to the
current '.html' file; each link is an anchor, but no inter-webpage navigation
is required for them.

That means that the browser may _not_ reload the page entirely when following
_those_ links in the multi-page HTML build -- and so the event is required to
close the menu for accessibility/usability purposes - but only for that subset
of hyperlinks.

Adding the patch would unnecessarily add the event handler to _all_ menu items;
now it seems to me that that's not what we want.  We only need the event
handler for links that refer to the same '.html' file.  But: that is all of
them in the 'singlehtml' build output.

So, in fact I'm wondering about a different question: should the menu link tree
(table of contents) be entirely expanded in 'singlehtml' format?  And should
the top-level item in the tree have the 'current' CSS class applied to it?

Or, alternatively -- should 'sphinx_rtd_theme' somehow figure out that the page
is a 'singlehtml' build, and omit '.current' from the CSS query in that case?

Reply via email to