docs: Prevent readthedocs from overriding collapse_navigation setting.

Expand bullets "[+]" show up on locals instance, but they
do not show up online on readthedocs. The expand icon is valuable
to indicate that each section has more content.

The problem is readthedocs appends code to conf.py that overrides the
html_theme_options prior to a build. This commit prevents this from
happening so that collapse_navigation remains set to False.

In response to merged PR 7326.
This commit is contained in:
David Rosa Tamsen 2017-11-17 12:40:58 -06:00 committed by Tim Abbott
parent 57c78da915
commit 4906bc8e4a
1 changed files with 5 additions and 0 deletions

View File

@ -113,6 +113,11 @@ if not on_rtd:
import sphinx_rtd_theme import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme' html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
else:
html_theme = 'sphinx_rtd_theme'
html_style = None
html_theme_options = {'collapse_navigation': False}
using_rtd_theme = True
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the