Hi Holger,

On Tue, 9 Jul 2024 at 21:30, Holger Wansing <hwans...@mailbox.org> wrote:
> [ ... snip ... ]
>
> Your patch works for me (tested on laptop with Firefox in a small window
> and on my smartphone).

Thank you for testing it!

I found that it was annoying to have to scroll all the way to the top of the
page again with the fix in place - but I suppose that is a separate problem.

> So the point is, how to integrate this in the manual...
>
> I think you know that this theme.js file is taken from sphinx-rtd-theme-common
> package and the manual is just placing a symlink to that file.
> So the correct fix long-term would be, to get it fixed in that package (thus 
> on
> sphinx upstream), but how long would that take?
> And will it ever happen? Or will upstream not change this, because it 
> conflicts
> with other circumstances?

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.

Upstream in this case is not Sphinx itself, but the ReadTheDocs project; I've
added a comment on the forwarded bugthread to let them know about the patch
here, in the hope of offering it to them too, or being told about a better way
to fix the same problem.

> So, should we fix it for the meantime via a little hack in our Makefile
> resp. debian/rules?

I'd prefer to patch the 'theme.js' file directly.  Although upstream minifies
the JavaScript code from that file, we copy it nearly-unmodified:

  
https://sources.debian.org/src/sphinx-rtd-theme/2.0.0%2Bdfsg-1/debian/rules/#L23

> > It would be nice to figure out whether the CSS query worked in the past;
> > perhaps this bug is a regression.
>
> I don't know exactly what you mean by "the CSS query worked".
> I can reproduce this issue here on Debian bookworm, which has sphinx
> version 5.3.0 included, while the developers-reference package is getting
> built on unstable with sphinx version 7.3.x.
> I guess, this does not confirm the thesis of a regression?

Browsing the code history, that CSS query appears in sphinx_rtd_theme.git (the
upstream sources) as far back as v0.1.8 (Y2015) and earlier:

  
https://github.com/readthedocs/sphinx_rtd_theme/blob/b5b633a8415de721b18e79bdf5d72a4973496fec/sphinx_rtd_theme/static/js/theme.js#L16

So although it may not be a recent regression, it's possible that it
functioned correctly at the time it was written.  If it did, then my suggested
patch -- although it may seem to work -- could be a sidetrack.

Regards,
James

Reply via email to