-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add local TOC as right sidebar for #764 #919
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for giving a try on this! I tried this same thing a while back and it looked promising, but did introduce some UX issues with the existing global toc. We'll want to address these sort of issues and put this all under a configuration setting, but I think calling To start, can you run |
No problem! Yea, having the ability to turn the local TOC off, at a minimum, would be nice.
For sure, CSS isn't exactly my strong suit so there are probably some leftovers from all the trial and error.
This has been done now and pushed. |
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.
We will want this to be a theme option, to start out at least.
When the option is enabled I think theme_includehidden
should be forcible disabled.
This should solve the UX of using both the global toc and local toc together.
The css side seems okay, there should be a way to collapse the local toc when the page is narrow.
Great functionality, but I don't know how to configure it? |
This PR adds a table of contents for the local headings on the page (excluding the page title) as a right sidebar, as mentioned in #764. This implementation is similar to the one in GitLab's Handbook in that is moves the local TOC to the top of the page on smaller screens.
You can see my downstream implementation as a live demo here: https://docs.netgate.com/pfsense/en/latest/vpn/scaling.html
This PR is viewable at https://sphinx-rtd-theme--919.org.readthedocs.build/en/919/
Preview: