-
Notifications
You must be signed in to change notification settings - Fork 328
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
ENH: be able to configure the number of levels in the page TOC #237
Comments
I think this would certainly be a nice addition to the theme. I thought originally this would be fairly straightforward. But, currently, this collapsing behaviour is defined in css here: I am not fully sure what the best way is to change something in the css based on a sphinx config option (normally you could have a templated css file with sphinx, but since we already use SASS preprocessor, not sure that is possible). The easiest is maybe in the html template to use a different class name for both options, and then we can have different css for both classes (one that collapses, the other not). |
I am definitely not the CSS expert who can help with any suggestions but happy to try anything out if that's ever useful! Also just for a concrete example of where this would be useful, there is this page: https://docs.bokeh.org/en/latest/docs/user_guide/interaction/widgets.html It only has two top level headings on load But being able to automatically see on more level would make the page much more usable: |
Yes, that's certainly a good use case. In an ideal case, what is your preference for the solution (feature wise, not technical):
|
BTW, short term, it can also be customized with a relatively straightforward css override of the snippet I showed above. |
I think this is a great idea 👍 I'd imagine behavior like: in conf.py {
"toc_show_levels": 2
} and this would make all TOC levels up to 2 always shown, with sub-levels shown on scroll. |
Global config is fine with me |
Currently we collapse all but the first level of headers, and then only show additional levels for the section where you are at the page.
In some case (e.g. when having relatively short pages), it might actually be perferable to show more or all levels by default and not collapse them.
@bryevdv @bjnath
The text was updated successfully, but these errors were encountered: