-
Notifications
You must be signed in to change notification settings - Fork 715
docs: allow TOC navigation #8196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hmm, it doesn't seem to work when rendered… It did work locally. |
Have you checked in the build report that the same package versions are used locally and on rtd? In case of mismatch, you can upgrade requirements in Lines 1 to 5 in 5b64eae
and then run make -C doc to generate requirements.txt .E.g. recently we upgraded to Sphinx >= 5 and sphinx_rtd_theme >= 1 for the Agda docs:
|
Wow, where do I find these logs normally? I tried to find something like it before but failed miserably: neither docs.readthedocs.io, nor any of GitHub CI links helped (I also googled of course). These logs have two strange things. First, they mention two versions of Second curious thing in the logs, and it looks like the culprit, is that I don't see my patch applied at all! The logs have |
I added a commit that upgrades to Sphinx >= 5. This seems to trigger new warnings:
In the rendered docs, I still do not see a change of behavior (over 3.6) what the TOC concerns. |
Mystery solved: readthedocs/readthedocs.org#1622 i.e. RTD server messes around with I'm not sure what to do with the warnings introduced with Sphinx update: as we learned, Sphinx version is nor related to the mystery, and the warnings make CI red... |
033702e
to
0eaa5c0
Compare
In my last commit, I am trying to fix this by following the instruction on https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html P.S.: I checked 2 instances of the rendering of extlinks (e.g. |
doc/conf.py
Outdated
if on_rtd: # only import and set the theme if we're building docs locally | ||
html_theme = 'sphinx_rtd_theme' | ||
html_style = None | ||
using_rtd_theme = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be clearer to combine this with the if not on_rtd:
block above. E.g.
html_theme = 'sphinx_rtd_theme'
# only import the theme if we're building docs locally
if on_rtd:
html_style = None
using_rtd_theme = True
else:
import sphinx_rtd_theme
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch, thank you! Just did it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested it, but the diff look good to me!
I intend to reshuffle and squash manually such that there are two commits: one about Sphinx update, and one about TOC unfolding. Let me know if you have a better idea. |
Ok, that was a short notice, as I just did the history cleanup. (Old history is still around, right here, if you're curious.) |
fix warnings: update extlinks format to Sphinx 5
👍🏻 https://cabal.readthedocs.io/en/latest looks amazing! |
It annoys me beyond measure that I can't freely browse TOC (in the left sidebar) without jumping between pages. It turned out there's a little switch that allows you to (almost) freely unfold menu items, and I turn it on in this PR.
Why "almost" is because it will still only show one section unfolded at a time. There's a long-standing PR to fix that: readthedocs/sphinx_rtd_theme#692 I think that it's still way better than the current state.
Another related but different idea is to have the TOC fully unfolded always. I'm less sure that I'd want that (perhaps I'd), but
sphinx_rtd_theme
currently doesn't allow it out of the box: readthedocs/sphinx_rtd_theme#455Here's what TOC will look like, and you can unfold entries by clicking in [+] without leaving the current page
