-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
TOC in navigation side bar is generated incorrectly for depth > 3 #12926
Comments
Not really sure if this was an intended behavior in global toctree generation to avoid generating siblings at every level of depth in order to reduce build times. |
This likely depends on the HTML theme you are using. With the default What theme are you using? |
I'm using alabaster too. Sorry for the wrong assumption, the issue I had a hard time reproducing as well and I figured that the problem occurred due to adding a toctree entry of some document and building the second time while keeping previous build's files. Here is the reproducer: $ cat index.rst
index
-----
.. toctree::
a
$ cat b.rst
b
--
.. toctree::
$ cat c.rst
c
--
$ sphinx-build -b html . _build/
$ # add doc c into b's toctree
$ vi b.rst
$ cat b.rst
b
--
.. toctree::
c
$ # build again
$ sphinx-build -b html . _build/
$ cat _build/c.html | grep 'href="a.html"'
<li class="toctree-l1"><a class="reference internal" href="a.html">a</a></li>
$ cat _build/c.html | grep 'href="b.html"'
$ cat _build/c.html | grep 'href="#"' c.html should contain links to a,b and self, however it only contains a link to a.html |
Describe the bug
The global table of contents in the navigation side bar isn’t generated correctly when the depth of the current document is more than 3.
How to Reproduce
$ cat index.rst index ------ .. toctree:: a $ cat a.rst a -- .. toctree:: b $ cat b.rst b -- .. toctree:: c $ cat c.rst c -- .. toctree:: d $ cat d.rst d -- $ sphinx-build -m html . _build
Output
Table of contents in navigation sidebar on page
d.html
only shows link to pagea
Expected Output
All the ancestors till the current page: a, b, c, d were expected to be shown.
Environment Information
Sphinx extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: