sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.63k stars 2.13k forks source link

[docs] Show nested pages of sections as collapsible menus in the sidebar #10662

Open choldgraf opened 2 years ago

choldgraf commented 2 years ago

The current sidebar implementation only shows the next level of pages below the current level. This makes it difficult for users to understand the context of the current page relative to other pages, and makes it hard to quickly navigate the titles of sections across the site in order to find the information that they want.

image

I propose that the Sphinx documentation implements functionality to include sub-pages in the sidebar, so that users can navigate anywhere from anywhere via links. Examples of how this looks in Furo and the PyData theme:

Furo ![chrome_FbHzgerxyh](https://user-images.githubusercontent.com/1839645/178218571-20764bae-e7f0-492b-a117-eae499cf5ce8.gif)
PyData ![chrome_WgQFnyS8dS](https://user-images.githubusercontent.com/1839645/178218919-e4c8a997-a8cb-4461-83a3-88dd286c94de.gif)
tk0miya commented 2 years ago

+1; It's worth a try.

mgeier commented 2 years ago

I just wanted to note that the sphinx_rtd_theme has a collapse_navigation setting (https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html#confval-collapse_navigation) where expanding the other sections is by default deactivated and they warn about activating it:

Setting collapse_navigation to False and using a high value for navigation_depth on projects with many files and a deep file structure can cause long compilation times and can result in HTML files that are significantly larger in file size.

I think I prefer not having this feature, but if we get it, it should be possible to deactivate it to avoid the negative effects.

DinaAlHeyari commented 1 month ago

Hi, Is there a way where I can have sub-pages in the sidebar when using Sphinx for documentation?