-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Specifying tocdepth doesn't influence the sidebar TOC depth on that page #6033
Comments
@jorisvandenbossche That seems to be an issue with the theme: sphinx-doc/alabaster#89 Do you have the same issue with other themes? When testing this with sphinx_rtd_theme I found that setting |
On my own project, this is bugging out differently. Setting Sphinx 2.1.2 |
Seems that using https://pypi.org/project/sphinxcontrib-fulltoc/ also resolves this issue. |
Confirmed. Indeed In my short investigation, it modifies the depth of local toctree. But alabaster uses global toctree instead. So I agree with you that our document is not kind. So I'll update it to mention about above behavior later. |
docs: Add a restriction note about tocdepth (refs: #6033)
I just added a note to our document. Closing. |
Describe the bug
I am trying to use
:tocdepth:
to specify the depth of the toctree in the sidebar on a specific page. However, whatever depth I specify, it doesn't make the toctree on that page deeper.Example set-up of my docs is here: https://github.com/jorisvandenbossche/sphinx-test/tree/master/test-toctree
So basically, I have a subdirectory with pages. And on those individual pages, I want that the sidebar toc also shows additional toc levels for the sections on that page.
On the main
index.rst
page, I included the toc with a:maxdepth: 2
, because on the body of that page, I want to show only a limited table of contents of the site.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect that a
:tocdepth:
on a certain page would overrule the:maxdepth:
of a toctree in the sidebar.However, it might be that my expectation is wrong. If so, it is not fully clear to me what the purpose is of
:tocdepth:
, and the documentation saying "The maximum depth for a table of contents of this file." (docs) is also not that very clarifying.But, going from some old threads on sphinx-users (eg https://groups.google.com/forum/#!searchin/sphinx-users/tocdepth|sort:date/sphinx-users/SqY5O0jM1JA/i74RIRoIBwAJ or https://groups.google.com/forum/#!searchin/sphinx-users/tocdepth|sort:date/sphinx-users/TzfuzcDo7Hs/RUOiOtIGI04J), I understand that
:tocdepth:
should be able to control the depth of the sidebar TOC.Environment info
The text was updated successfully, but these errors were encountered: