From f84417a5be82811f022c42135e41e89c17891ba7 Mon Sep 17 00:00:00 2001
From: Terry Chia <terrycwk1994@gmail.com>
Date: Wed, 9 Jul 2014 14:41:30 +0800
Subject: [PATCH] Added rtd docs theme to tox build.

---
 docs/conf.py | 11 ++++++++++-
 tox.ini      |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/conf.py b/docs/conf.py
index 87781d79..ec2d8e56 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -10,6 +10,11 @@
 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.
@@ -95,7 +100,11 @@ 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
diff --git a/tox.ini b/tox.ini
index b12e47ca..d778dfba 100644
--- a/tox.ini
+++ b/tox.ini
@@ -13,6 +13,7 @@ commands =
 [testenv:docs]
 deps =
     sphinx
+    sphinx_rtd_theme
 basepython = python2.7
 commands =
     sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
-- 
GitLab