From 6346a9670d5862d117654dc497afb8b8f635588a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 14 Oct 2014 14:49:50 +0200 Subject: [PATCH] add rtd_theme for local builds --- source/conf.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/conf.py b/source/conf.py index 5c2331ea5..fb37071c5 100644 --- a/source/conf.py +++ b/source/conf.py @@ -102,7 +102,7 @@ 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' +html_theme = 'default' #overriden if run locally, see end of file # 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 @@ -265,7 +265,7 @@ texinfo_documents = [ # -- Options for Epub output ---------------------------------------------- # Bibliographic Dublin Core info. -epub_title = 'chill-doc' +epub_title = 'Chill Documentation' epub_author = 'Champs-Libres' epub_publisher = 'Champs-Libres' epub_copyright = '2014, Champs-Libres' @@ -330,3 +330,13 @@ epub_exclude_files = ['search.html'] # If false, no index is generated. #epub_use_index = True + +# 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()] + +# otherwise, readthedocs.org uses their theme by default, so no need to specify it