mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Add titles_only option to the toc (#456)
* Add titles_only option * Add titles_only to readme * Add titles_only to readme * Convert Strings to bool Fixes #312
This commit is contained in:
parent
e9db692de0
commit
bf9faa98f0
@ -99,6 +99,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via
|
||||
'sticky_navigation': True,
|
||||
'navigation_depth': 4,
|
||||
'includehidden': True,
|
||||
'titles_only': False
|
||||
}
|
||||
|
||||
The following options are available:
|
||||
@ -124,6 +125,7 @@ These effect how we display the Table of Contents in the side bar. You can read
|
||||
* ``collapse_navigation`` With this enabled, you will lose the `[+]` drop downs next to each section in the sidebar. This is useful for _very large_ documents.
|
||||
* ``sticky_navigation`` This causes the sidebar to scroll with the main page content as you scroll the page.
|
||||
* ``includehidden`` Specifies if the sidebar includes toctrees marked with the `:hidden:` option
|
||||
* ``titles_only`` If True, removes headers within a page from the sidebar.
|
||||
|
||||
Page-level configuration
|
||||
------------------------
|
||||
|
@ -111,6 +111,7 @@ html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_options = {
|
||||
# 'sticky_navigation': True # Set to False to disable the sticky nav while scrolling.
|
||||
# 'logo_only': True, # if we have a html_logo below, this shows /only/ the logo with no title text
|
||||
# 'titles_only': False # If True, it'll remove headers within a page from the sidebar.
|
||||
}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
|
@ -133,7 +133,10 @@
|
||||
toctree is empty. Skip building this for now.
|
||||
#}
|
||||
{% if 'singlehtml' not in builder %}
|
||||
{% set global_toc = toctree(maxdepth=theme_navigation_depth|int, collapse=theme_collapse_navigation, includehidden=theme_includehidden) %}
|
||||
{% set global_toc = toctree(maxdepth=theme_navigation_depth|int,
|
||||
collapse=theme_collapse_navigation|tobool,
|
||||
includehidden=theme_includehidden|tobool,
|
||||
titles_only=theme_titles_only|tobool) %}
|
||||
{% endif %}
|
||||
{% if global_toc %}
|
||||
{{ global_toc }}
|
||||
|
@ -11,6 +11,7 @@ collapse_navigation = False
|
||||
sticky_navigation = True
|
||||
navigation_depth = 4
|
||||
includehidden = True
|
||||
titles_only =
|
||||
logo_only =
|
||||
display_version = True
|
||||
prev_next_buttons_location = bottom
|
||||
|
Loading…
Reference in New Issue
Block a user