Skip to content

Commit b5ca7c0

Browse files
committed
docs: Use RTD theme locally
Ensure out local docs builds look similar to what's on ReadTheDocs. Some unnecessary noise is removed from the doc configuration file. Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent 4b532c3 commit b5ca7c0

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

docs/conf.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
#
33
# git-pw documentation build configuration file
44

5+
try:
6+
import sphinx_rtd_theme
7+
has_rtd_theme = True
8+
except ImportError:
9+
has_rtd_theme = False
10+
511
# -- General configuration ------------------------------------------------
612

713
# If your documentation needs a minimal Sphinx version, state it here.
@@ -46,11 +52,6 @@
4652
# Usually you set "language" from the command line for these cases.
4753
language = None
4854

49-
# List of patterns, relative to source directory, that match files and
50-
# directories to ignore when looking for source files.
51-
# This patterns also effect to html_static_path and html_extra_path
52-
exclude_patterns = []
53-
5455
# The name of the Pygments (syntax highlighting) style to use.
5556
pygments_style = 'sphinx'
5657

@@ -65,15 +66,5 @@
6566
# The theme to use for HTML and HTML Help pages. See the documentation for
6667
# a list of builtin themes.
6768
#
68-
html_theme = 'default'
69-
70-
# Theme options are theme-specific and customize the look and feel of a theme
71-
# further. For a list of options available for each theme, see the
72-
# documentation.
73-
#
74-
# html_theme_options = {}
75-
76-
# Add any paths that contain custom static files (such as style sheets) here,
77-
# relative to this directory. They are copied after the builtin static files,
78-
# so a file named "default.css" will overwrite the builtin "default.css".
79-
html_static_path = []
69+
if has_rtd_theme:
70+
html_theme = 'sphinx_rtd_theme'

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ sphinx>=1.5,<2.0
33
sphinx-click>=1.0,<2.0
44
click-man>=0.2,<0.3
55
reno>=2.0,<3.0
6+
sphinx_rtd_theme==0.3.1

0 commit comments

Comments
 (0)