add support to rtd_theme without is installation Signed-off-by: sebgoa <sebgoa@sebimac.local>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/commit/42c1af60 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/tree/42c1af60 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/diff/42c1af60 Branch: refs/heads/master Commit: 42c1af601f84c98ed9c75ea63aa951288bf4ddeb Parents: 49fa817 Author: Pierre-Luc Dion <pd...@voilevacance.ca> Authored: Tue Apr 29 20:24:58 2014 -0400 Committer: sebgoa <sebgoa@sebimac.local> Committed: Wed Apr 30 12:03:01 2014 +0200 ---------------------------------------------------------------------- source/conf.py | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack-docs-rn/blob/42c1af60/source/conf.py ---------------------------------------------------------------------- diff --git a/source/conf.py b/source/conf.py index c18daa9..6d9b561 100644 --- a/source/conf.py +++ b/source/conf.py @@ -31,6 +31,8 @@ import sys import os +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + # 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 # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -119,6 +121,13 @@ 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' +if not on_rtd: + try: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + except ImportError: + pass # 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