[pypy-commit] pypy default: Merged in techtonik/pypy (pull request #230)

arigo noreply at buildbot.pypy.org
Mon May 19 10:40:12 CEST 2014


Author: Armin Rigo <armin.rigo at gmail.com>
Branch: 
Changeset: r71587:250638982fbe
Date: 2014-05-19 10:39 +0200
http://bitbucket.org/pypy/pypy/changeset/250638982fbe/

Log:	Merged in techtonik/pypy (pull request #230)

	docs: Use read the docs theme if available

diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -18,6 +18,24 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 sys.path.append(os.path.abspath('.'))
 
+
+# -- Read The Docs theme config ------------------------------------------------
+
+# 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 not on_rtd:  # only import and set the theme if we're building docs locally
+  try:
+    import sphinx_rtd_theme
+    html_theme = 'sphinx_rtd_theme'
+    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+  except ImportError:
+    print('sphinx_rtd_theme is not installed')
+    html_theme = 'default'
+
+# otherwise, readthedocs.org uses their theme by default, so no need to specify it
+
+
 # -- General configuration -----------------------------------------------------
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
@@ -93,7 +111,7 @@
 
 # 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'
 
 # 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


More information about the pypy-commit mailing list