on master help sign in
Can build docs locally using ReadTheDocs Theme.
a687f5dJan de Muijnck-Hughes
docs/README.md+6
@@ -18,6 +18,12 @@ Sphinx can be installed either through your hosts package manager or using pip/e
18 of readthedocs and be ignored. In the past we had several code-blocks
18 of readthedocs and be ignored. In the past we had several code-blocks
19 disappear because of that.
19 disappear because of that.
20
20
21+The ReadTheDocs theme can be installed using pip as follows:
22+
23+```sh
24+pip install sphinx_rtd_theme
25+```
26+
21### LaTeX
27### LaTeX
22
28
23LaTeX can be install either using your systems package manager or direct from TeXLive.
29LaTeX can be install either using your systems package manager or direct from TeXLive.
docs/conf.py+10
@@ -15,6 +15,9 @@
15import sys
15import sys
16import os
16import os
17
17
18+# True if the readthedocs theme is locally installed
19+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
20+
18# If extensions (or modules to document with autodoc) are in another directory,
21# If extensions (or modules to document with autodoc) are in another directory,
19# add these directories to sys.path here. If the directory is relative to the
22# add these directories to sys.path here. If the directory is relative to the
20# documentation root, use os.path.abspath to make it absolute, like shown here.
23# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -111,6 +114,13 @@ todo_include_todos = True
111# a list of builtin themes.
114# a list of builtin themes.
112html_theme = "default"
115html_theme = "default"
113
116
117+if not on_rtd: # only import and set the theme if we're building docs locally
118+ import sphinx_rtd_theme
119+ html_theme = 'sphinx_rtd_theme'
120+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
121+
122+
123+
114# Theme options are theme-specific and customize the look and feel of a theme
124# Theme options are theme-specific and customize the look and feel of a theme
115# further. For a list of options available for each theme, see the
125# further. For a list of options available for each theme, see the
116# documentation.
126# documentation.