From 76936c9afdc1b92cc2f972f4355a28bc24a90169 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 10 Mar 2018 12:11:25 +0100 Subject: [PATCH] Add theme options --- docs/conf.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2f0e3316..83810e5d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,6 +5,7 @@ # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config +import os # -- Path setup -------------------------------------------------------------- @@ -15,7 +16,6 @@ # import os # import sys # sys.path.insert(0, os.path.abspath('.')) -import sphinx_rtd_theme from recommonmark.parser import CommonMarkParser @@ -33,6 +33,9 @@ release = u'' # -- General configuration --------------------------------------------------- +# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' @@ -77,13 +80,38 @@ pygments_style = 'sphinx' # a list of builtin themes. # #html_theme = 'alabaster' -html_theme = 'sphinx_rtd_theme' +#html_theme = 'sphinx_rtd_theme' +html_theme = 'default' + +# From: +# * https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs + +if not on_rtd: # only import and set the theme if we're building docs locally + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # 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 # documentation. # # html_theme_options = {} +# https://sphinx-rtd-theme.readthedocs.io/en/latest/configuring.html#project-wide-configuration +#html_theme_options = { +# 'canonical_url': '', +# 'analytics_id': '', +# 'logo_only': False, +# 'display_version': True, +# 'prev_next_buttons_location': 'bottom', +# 'style_external_links': False, +# #'vcs_pageview_mode': '', +# # Toc options +# 'collapse_navigation': False, +# 'sticky_navigation': True, +# 'navigation_depth': 4, +# #'includehidden': True, +# 'titles_only': False +#} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files,