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

Best-practices for sidebar management #322

Closed
rossbar opened this issue Feb 26, 2021 · 3 comments
Closed

Best-practices for sidebar management #322

rossbar opened this issue Feb 26, 2021 · 3 comments

Comments

@rossbar
Copy link
Contributor

rossbar commented Feb 26, 2021

While converting the numpydoc documentation over to the pydata-sphinx-theme, we encountered the following scenario:

numpydoc's documentation has a "flat" structure - namely, only the master_doc (index.rst) has a .. toctree that refers to every other document. This means that the left sidebar, which is based on the toctree in the given doc, will always be empty.

My first thought was that, since it will always be empty, we could to remove the dead space and allow the content to use the full width (see #146). However, even after #263 it doesn't seem that there's a way to completely get rid of the left sidebar and allow the central content to use the full page width.

My second thought was that we could actually replace the content of the left sidebar with that of the right sidebar, which summarizes the intra-document structure. This turned out to work well (see numpy/numpydoc@0fd8506), but in order to suppress the right sidebar (which is now redundant) I had to add the :notoc: metadata to each file. This latter step felt kind of hacky because a) it's undocumented, so I'm not sure it's intended to be relied upon and b) it requires adding metadata to each source file.

I mostly wanted to raise the issue to illustrate the use-case and see if there were any other suggestions for how to handle this. I like the outcome of the sidebar-swapping solution, but I wasn't sure that this was going to be a viable option moving forward. If a config option were added to control the right sidebar at the project level (e.g. show_right_sidebar=<bool>), then I think this would be a nice solution and potentially worth documenting for other smaller projects with toctree-less docs.

@jpmckinney
Copy link
Contributor

jpmckinney commented May 14, 2021

Related: #221 #90

@choldgraf
Copy link
Collaborator

This might be close-able now? If you use html_sidebars and provide an empty list (e.g., html_sidebars = {"**": []}) then the docs should grow to be wider. @rossbar can we resolve this issue?

@rossbar
Copy link
Contributor Author

rossbar commented May 14, 2021

can we resolve this issue?

Yes this is okay to close from my perspective 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants