]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
doc: Use RTD theme locally
authorStephen Finucane <stephen@that.guru>
Thu, 2 Nov 2017 16:23:02 +0000 (16:23 +0000)
committerStephen Finucane <stephen@that.guru>
Thu, 2 Nov 2017 16:23:57 +0000 (16:23 +0000)
This ensures things look the same locally as on readthedocs.org.

Signed-off-by: Stephen Finucane <stephen@that.guru>
docs/conf.py
docs/requirements.txt

index 652566e46e6a2c2e6293cda5130da58653091b47..f692cf917ea0a2433442bc3f79dc78cadee8d814 100644 (file)
@@ -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 = []
 
index e23dfd31047ab28d5ca19458a0994654981f7c1f..86571f40871f81ea559f6f2891f17acfbfcca7b4 100644 (file)
@@ -1,2 +1,3 @@
 sphinx>=1.5
 reno>=2.2
+sphinx_rtd_theme==0.2.4