From 151b3f1117c8b3fe464281cc836d4b4e36f3f0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Sat, 25 Jan 2014 16:20:06 +0100 Subject: [PATCH] Use readthedocs theme for docs --- docs/source/conf.py | 14 ++++++++++++-- setup.py | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 645a493c..70c104f6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,10 +10,20 @@ extensions = ['powerline_autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sp source_suffix = '.rst' master_doc = 'index' project = u'Powerline' -copyright = u'Kim Silkebækken' version = 'beta' release = 'beta' exclude_patterns = ['_build'] pygments_style = 'sphinx' -html_theme = 'default' +html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] +html_show_copyright = False + +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 ImportError: + pass diff --git a/setup.py b/setup.py index 16561d85..d397e03e 100755 --- a/setup.py +++ b/setup.py @@ -92,6 +92,7 @@ setup( extras_require={ 'docs': [ 'Sphinx', + 'sphinx_rtd_theme', ], }, test_suite='tests' if not OLD_PYTHON else None,