Skip to content

Make it possible to put the entire site toctree in the left sidebar and populate the header with custom links #944

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

Open
choldgraf opened this issue Sep 23, 2022 · 4 comments
Labels
kind: enhancement New feature or request

Comments

@choldgraf
Copy link
Collaborator

choldgraf commented Sep 23, 2022

Context

Currently, the top-level sections of your documentation will become links in the header, and the left sidebar will only show the sub-sections for the active top-level section.

However, we've now seen many themes that instead want to define their own custom links in the top-level header, and then put the entire documentation structure in the left sidebar (similar to how a traditional Sphinx site works).

In this case, what sites usually do is add custom templating to the Sphinx Book Theme. Sites often use this in order to have the same theme across subsets of your documentation. for example:

Proposal

We could make it possible for people to achieve this effect without using a different theme by making two changes:

  • Make it possible for the left sidebar to include the full site TOCtree instead of just the second-level items (e.g., via activating a template)
  • Make it possible for the header links to only be external links (maybe with dropdowns as well)
@choldgraf choldgraf added the kind: enhancement New feature or request label Sep 23, 2022
@choldgraf
Copy link
Collaborator Author

cc @wtbarnes and @eteq who both mentioned this might be useful

@wtbarnes
Copy link

Also tagging @nabobalis as he has taken the lead on the refactor of the sunpy sphinx theme on top of the sphinx book theme.

@Rchatru
Copy link

Rchatru commented Feb 9, 2023

Related to this issue, I have a doubt about this statement:

Currently, the top-level sections of your documentation will become links in the header

In my case the structure of my package is similar to the following:

.
└── my_package/
    ├── subpackage1/
    │   └── module1
    ├── subpackage2/
    │   ├── module2
    │   └── module3
    └── subpackage3/
        └── module4

And in header links, I only get a link to the top level element, in this case, "my_package", and I would like to have quick access from this bar, to the different subpackages. Would it be possible to modify the "depth", as can be done in toc, or manually add the links to these subpackages?

@dhapolapankaj
Copy link

Hello Guys,
I have a requirement here, I need to hide the right sticky panel and display the sub - heading (method name) permalink in left panel

Taking a cue from above example. I have a function1 as permalink in module1 below
Can we display the left sidebar in such a way that function1 permalink appears just below the module1?

.
└── my_package/
├── subpackage1/
│ └── module1
| └── function1
├── subpackage2/
│ ├── module2
│ └── module3
└── subpackage3/
└── module4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants