Skip to content
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: Make starting depth of sidebar configurable in generated html #309

Conversation

jorisvandenbossche
Copy link
Member

This generalizes how we currently select (with soup.select("li.current.toctree-l1") the "active" subset of the sphinx-generated html for the sidebar, that allows both disabling it (eg for a single sidebar) as setting it at a higher value (eg for a deeper nested page, where the navbar already selects two levels, eg with dropdown).

It adds a startdepth keyword for this, following the maxdepth terminology of sphinx (but we could certainly also go for something more explicit / readable if there are suggestions)

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - thanks for all the careful testing as well! One thing I note is that there aren't any major docs changes. However, it seems to me that this is mostly an "under the hood" change that makes it easier to use the theme in a "single sidebar" or a "topbar" mode. So there don't need to be any user-facing docs changes but perhaps we could add something to the developer docs? I don't think we need to block the PR on that, but WDYT @jorisvandenbossche ?

@jorisvandenbossche
Copy link
Member Author

Yes, this should certainly be documented. I would maybe first like to experiment a bit further with using it / creating a single sidebar version, to ensure it's fully working as I want, before documenting it (although this might sound like a good excuse to then eventually not do it ... ;-))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants