summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-02 19:57:01 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-02 19:57:01 -0400
commit736af3f5c1da02b58f5ccbbd00a2ee5c6317bc9e (patch)
tree6359b28f065be7d39ff4e6d92c436a90152da8bc
parent42ca5fd8170d1052cb35090a56eca1b95337f61f (diff)
downloadpython-coveragepy-git-736af3f5c1da02b58f5ccbbd00a2ee5c6317bc9e.tar.gz
Use the RTFD theme locally also.
-rw-r--r--doc/conf.py14
1 files changed, 13 insertions, 1 deletions
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