Permalink
Browse files

read the docs support

  • Loading branch information...
1 parent a9e65bb commit 821f79c07155706fd400b9d7e0d6bdebf6525866 @sb2nov sb2nov committed Mar 20, 2015
Showing with 13 additions and 4 deletions.
  1. +12 −4 docs/conf.py
  2. +1 −0 read_the_docs.txt
View
@@ -14,7 +14,15 @@
import sys
import os
-import sphinx_rtd_theme
+
+# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.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()]
+
# 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
@@ -34,7 +42,7 @@
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
- 'sphinxcontrib.napoleon'
+ 'sphinx.ext.napoleon'
]
# Napoleon settings
@@ -117,15 +125,15 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'sphinx_rtd_theme'
+# html_theme = 'sphinx_rtd_theme'
# 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 = [sphinx_rtd_theme.get_html_theme_path()]
+# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
View
@@ -0,0 +1 @@
+Sphinx>=1.3.1

0 comments on commit 821f79c

Please sign in to comment.