From: Stephen Finucane Date: Thu, 2 Nov 2017 16:23:02 +0000 (+0000) Subject: doc: Use RTD theme locally X-Git-Tag: v2.1.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56fe8c496d615359b4570249e4bd364912d95dd1;p=thirdparty%2Fpatchwork.git doc: Use RTD theme locally This ensures things look the same locally as on readthedocs.org. Signed-off-by: Stephen Finucane --- diff --git a/docs/conf.py b/docs/conf.py index 652566e4..f692cf91 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,6 +2,12 @@ # # Patchwork documentation build configuration file +try: + import sphinx_rtd_theme + has_rtd_theme = True +except ImportError: + has_rtd_theme = False + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -13,6 +19,11 @@ needs_sphinx = '1.5' # ones. extensions = ['sphinx.ext.todo', 'reno.sphinxext'] +if has_rtd_theme: + html_theme = 'sphinx_rtd_theme' + # TODO(stephenfin): Remove this once we use v0.2.5 + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + # Add any paths that contain templates here, relative to this directory. templates_path = [] diff --git a/docs/requirements.txt b/docs/requirements.txt index e23dfd31..86571f40 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ sphinx>=1.5 reno>=2.2 +sphinx_rtd_theme==0.2.4