From 27283cfa4300162f6a7a667364acab781c49710f Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 8 Nov 2013 10:49:22 -0800 Subject: Try to use the sphinx rtd theme locally if it's installed --- docs/conf.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 69be32e9..77050e72 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,6 +14,12 @@ import os import sys +try: + import sphinx_rtd_theme +except ImportError: + sphinx_rtd_theme = None + + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -98,16 +104,18 @@ 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' + +if sphinx_rtd_theme: + html_theme = "sphinx_rtd_theme" + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +else: + 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 # documentation. #html_theme_options = {} -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None -- cgit v1.2.3 From e29acd11b4d226dee1ee88bdd34ca72d4500b065 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 8 Nov 2013 11:08:32 -0800 Subject: Put the theme in dev-requirements --- dev-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-requirements.txt b/dev-requirements.txt index 752517dd..8e9a4ab0 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -4,3 +4,4 @@ pytest coverage sphinx tox +sphinx_rtd_theme -- cgit v1.2.3 From 13ec4799e47b5180d397e2f5028005c58e8e93be Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 8 Nov 2013 14:09:21 -0800 Subject: Include in tox.ini --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index dab22a6d..257275ce 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,9 @@ commands = coverage report -m [testenv:docs] -deps = sphinx +deps = + sphinx + sphinx_rtd_theme basepython = python2.7 commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html -- cgit v1.2.3