summaryrefslogtreecommitdiffstatshomepage
path: root/docs/conf.py
diff options
context:
space:
mode:
authorevildmp <daniele@vurt.org>2014-11-06 00:14:26 +0000
committerDamien George <damien.p.george@gmail.com>2014-11-15 19:01:19 +0000
commitaec189a5ba4e1feac82625507851d4188f6dd510 (patch)
tree7d9781ae28543267fad13d2fe99ab684834433e3 /docs/conf.py
parentca0b0cb83f55afddc0b8055f6283dc13f7cafdc6 (diff)
downloadmicropython-aec189a5ba4e1feac82625507851d4188f6dd510.tar.gz
micropython-aec189a5ba4e1feac82625507851d4188f6dd510.zip
docs: Add optional sphinx_rtd_theme; add docs build instructions.
The sphinx_rtd_theme is used by ReadTheDocs to render a pretty looking documentation. If you have this theme installed locally then your locally-compiled docs will look exactly like the published documentation. Otherwise it falls back to the default theme.
Diffstat (limited to 'docs/conf.py')
-rwxr-xr-x[-rw-r--r--]docs/conf.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 9d671f0abd..0eee4c0901 100644..100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -103,9 +103,17 @@ pygments_style = 'sphinx'
# -- Options for HTML output ----------------------------------------------
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-html_theme = 'default'
+# 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
+ try:
+ import sphinx_rtd_theme
+ html_theme = 'sphinx_rtd_theme'
+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
+ except:
+ html_theme = 'default'
+ html_theme_path = ['.']
# 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
@@ -113,7 +121,7 @@ html_theme = 'default'
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ['.']
+# html_theme_path = ['.']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
@@ -154,7 +162,7 @@ html_last_updated_fmt = '%d %b %Y'
# Additional templates that should be rendered to pages, maps page names to
# template names.
-html_additional_pages = {"index":"topindex.html"}
+html_additional_pages = {"index": "topindex.html"}
# If false, no module index is generated.
#html_domain_indices = True
@@ -234,7 +242,7 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'micropython', 'Micro Python Documentation',
- ['Damien P. George'], 1)
+ ['Damien P. George'], 1),
]
# If true, show URL addresses after external links.