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

globaltoc_maxdepth #757

Open
jamesdbrock opened this issue Sep 14, 2023 · 4 comments
Open

globaltoc_maxdepth #757

jamesdbrock opened this issue Sep 14, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@jamesdbrock
Copy link

Describe the bug

context

Sphinx                        5.3.0
sphinx-book-theme             1.0.1

conf.py:

html_theme = 'sphinx_book_theme'
html_theme_options = {
    "globaltoc_maxdepth": 1,
}

expectation

The left sidebar table of contents should be limited to a depth of 1.

bug

The left sidebar table of contents has a depth of 3.

image

problem

Is the sphinx-book-theme supposed to respect "globaltoc_maxdepth"? Does anyone know how to limit the depth of the left sidebar table of contents?

Reproduce the bug

List your environment

I'm not running jupyter-book, I'm running sphinx-build.

$ sphinx-build --version
sphinx-build 5.3.0
@jamesdbrock jamesdbrock added the bug Something isn't working label Sep 14, 2023
@welcome
Copy link

welcome bot commented Sep 14, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@jamesdbrock
Copy link
Author

jamesdbrock commented Sep 14, 2023

It seems like maybe the left sidebar table of contents maxdepth is hard-coded as 4?

@jamesdbrock
Copy link
Author

Maybe I can customize the left sidebar with these instructions. https://github.com/executablebooks/sphinx-book-theme/blob/master/docs/sections/sidebar-primary.md

@jamesdbrock
Copy link
Author

Ok I got this working. I copyed the file sbt-sidebar-nav.html to a local file sphinx_book_theme_override/sbt-sidebar-nav-override.html and changed it to read maxdepth=2,.

Then in conf.py:

templates_path = ['_templates', './sphinx_book_theme_override']

html_sidebars = {
    "**": ["navbar-logo.html", "sbt-sidebar-nav-override.html"]
}

But it would be nice if the sphinx_book_theme respected globaltoc_maxdepth. So I'll leave this issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant