Skip to content

Commit 7050d54

Browse files
authored
MOTOR-1362 Use furo theme in ReadTheDocs (#304)
1 parent b652685 commit 7050d54

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

doc/conf.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,20 @@
124124

125125
html_copy_source = False
126126

127-
# Theme gratefully vendored from CPython source.
128-
html_theme = "pydoctheme"
129-
html_theme_path = ["."]
130-
html_theme_options = {"collapsiblesidebar": True}
131-
html_static_path = ["static"]
132-
133-
html_sidebars = {
134-
"index": ["globaltoc.html", "searchbox.html"],
135-
}
127+
try:
128+
import furo # noqa: F401
129+
130+
html_theme = "furo"
131+
except ImportError:
132+
# Theme gratefully vendored from CPython source.
133+
html_theme = "pydoctheme"
134+
html_theme_path = ["."]
135+
html_theme_options = {"collapsiblesidebar": True}
136+
html_static_path = ["static"]
137+
138+
html_sidebars = {
139+
"index": ["globaltoc.html", "searchbox.html"],
140+
}
136141

137142
# The name for this set of Sphinx documents. If None, it defaults to
138143
# "<project> v<release> documentation".

requirements/docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ aiohttp
33
sphinx>=5.3,<8
44
sphinx_rtd_theme>=2,<3
55
readthedocs-sphinx-search~=0.3
6+
furo==2024.8.6

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ deps =
7878
-rrequirements/docs.txt
7979
changedir = doc
8080
commands =
81-
python -m sphinx -q -E -W -b html . {envtmpdir}/html {posargs}
81+
# TODO: MOTOR-1351 Add -W before releasing Motor 3.6.
82+
python -m sphinx -q -E -b html . {envtmpdir}/html {posargs}
8283

8384
[testenv:doctest]
8485
setenv = PYTHONHASHSEED=0

0 commit comments

Comments
 (0)