Skip to content

Commit 9df7a56

Browse files
committed
Merge pull request #28 from stof/sphinx_doc
Update the Sphinx configuration to use the ReadTheDocs theme
2 parents 0c2f7fd + 81dc3e9 commit 9df7a56

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ sudo: false
55
python:
66
- "2.7"
77

8+
install: pip install Sphinx==1.2.2 sphinx_rtd_theme
9+
810
script: sphinx-build -nW -b html -d build/doctrees . build/html

conf.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
2323
#sys.path.insert(0, os.path.abspath('.'))
2424

25+
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
26+
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
27+
28+
if not on_rtd: # only import and set the theme if we're building docs locally
29+
import sphinx_rtd_theme
30+
html_theme = 'sphinx_rtd_theme'
31+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
32+
33+
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
34+
2535
# -- General configuration -----------------------------------------------------
2636

2737
# If your documentation needs a minimal Sphinx version, state it here.
@@ -95,10 +105,6 @@
95105

96106
# -- Options for HTML output ---------------------------------------------------
97107

98-
# The theme to use for HTML and HTML Help pages. See the documentation for
99-
# a list of builtin themes.
100-
html_theme = 'sphinxdoc'
101-
102108
# Theme options are theme-specific and customize the look and feel of a theme
103109
# further. For a list of options available for each theme, see the
104110
# documentation.

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)