Make the right TOC hidden by choice #1171
Unanswered
72757373656c6c
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Regarding: sphinx-book-theme issue #102 - Make the right TOC hidden by choice
Currently the Secondary Sidebar behavior changes based on screen size.
It is always displayed for large screens, but for smaller screens a toggle button appears that displays or hides it. There is an issue when this occurs #835.
It is helpful to be able to toggle the Secondary Sidebar, even for large screens. There are a number of reasons why a large screen user may want a toggle for the Secondary Sidebar, but the primary one is horizontal real estate, especially if the font size is increased for visibility. The Secondary Sidebar may have served its' purpose, gave the user an overview of the Article Content and got the user where they needed to go, but now they need to focus on the Article Content. The Secondary Sidebar does overlay Article Content, and if there are no titles in the Article Content, there is no content for the Secondary Sidebar thus leaving an unappealing, wasteful space.
Ideally, the Secondary Sidebar would have an option in conf.py to always toggle. This would be a global option, affecting the entire project. The default behavior could be the current behavior (i.e., based on screen size).
Since this behavior is currently not configurable, I'd rather have the Secondary Sidebar displayed, even though it can hide Article Content,
But like #102, we came across a design requirement that would benefit greatly if the Secondary Sidebar was not displayed on certain documents. There is a need for a per document ability to display or not display the Secondary Sidebar.
The solution suggested in #102 was the foundation of the working solution shown below.
conf.py
css/main.css
css/content_sidebar
markdown document
Since there are a number of documents, they are batch processed putting the link statement at the end, before running
make html
.I was under the impression style had to be in the header, but that isn't the case. Here is a stackexchange discussion on this topic. Will it be a wrong idea to have <style> in ?
NOTE: If you use
import
method, you may need totouch main.css
beforemake html
to force Firefox to refresh imported css files, ymmv.2024.5.15 - Updated: to correct issue link.
Beta Was this translation helpful? Give feedback.
All reactions