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:
Paul 2017-12-15 21:15:39 -08:00 committed by Aaron Carlisle
parent e9db692de0
commit bf9faa98f0
4 changed files with 8 additions and 1 deletions

View File

@ -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
------------------------

View File

@ -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.

View File

@ -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 }}

View File

@ -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