Skip to content

Commit

Permalink
Only use RTD theme when not on RTD itself
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Mar 3, 2015
1 parent 12fa27c commit a8d98a9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,27 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
#
# Code below copied from:
# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs
# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

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 = {}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Note: the RTD theme path is commented out because it is added above
# **only** when not building on RTD itself. See:
# http://docs.readthedocs.org/en/latest/theme.html#how-do-i-use-this-locally-and-on-read-the-docs
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand Down

0 comments on commit a8d98a9

Please sign in to comment.