From edce44024b8593d2f8f7ae631d341dff5453e7bf Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Tue, 24 Feb 2015 16:12:31 +0000 Subject: [PATCH] Use sphinx_rtd_theme locally. --- docs/conf.py | 10 +++++++++- setup.py | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 018d2afed..24792d644 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -117,7 +117,15 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' + +# 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()] +# 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 diff --git a/setup.py b/setup.py index d35abc176..0568844d8 100755 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ dev_extras = [ docs_extras = [ 'repoze.sphinx.autointerface', 'Sphinx', + 'sphinx_rtd_theme', ] testing_extras = [