From 736af3f5c1da02b58f5ccbbd00a2ee5c6317bc9e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 2 Aug 2015 19:57:01 -0400 Subject: Use the RTFD theme locally also. --- doc/conf.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 30c0281f..56dbec23 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -23,6 +23,9 @@ import sys, os # Copied from django docs: sys.path.append(os.path.join(os.path.dirname(__file__), "_ext")) +# on_rtd is whether we are on readthedocs.org +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + # -- General configuration ----------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be extensions @@ -103,7 +106,16 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' +#html_theme = 'default' + +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()] + +# otherwise, readthedocs.org uses their theme by default, so no need to specify it + + # 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 -- cgit v1.2.1