Docs: Use RTD theme in local builds
Currently we use the default Sphinx theme for local builds, and the
ReadTheDocs theme online. Use the same theme in both cases to make it
easier to see locally how the documentation will look online.
@@ -113,6 +113,23 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
+
+# The Read the Docs theme is available from
+# https://github.com/snide/sphinx_rtd_theme
+#
+# Install with
+# - pip install sphinx_rtd_theme
+# or
+# - apt-get install python-sphinx-rtd-theme
+
+try:
+ import sphinx_rtd_theme
+ html_theme = 'sphinx_rtd_theme'
+except ImportError:
+ sys.stderr.write('Warning: The Sphinx \'sphinx_rtd_theme\' HTML theme was '+
+ 'not found. Make sure you have the theme installed to produce pretty '+
+ 'HTML output. Falling back to the default theme.\n')
+
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
