Skip to content

Commit dc238f0

Browse files
authored
Change rtd builder superclass (#1682)
* Change rtd builder superclass * simplify imports
1 parent 3ba173b commit dc238f0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

source/_extensions/rtd_patch.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Force RTD to build zip with regular html builder, not single html
2+
# The builder is preloaded after all extensions are loaded, so we can
3+
# change the registered class here.
4+
5+
from sphinx.builders.html import StandaloneHTMLBuilder
6+
7+
8+
class ReadtheDocsBuilderLocalMedia(StandaloneHTMLBuilder):
9+
name = "readthedocssinglehtmllocalmedia"
10+
11+
12+
def setup(app):
13+
app.add_builder(ReadtheDocsBuilderLocalMedia, override=True)

source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
local_extensions = [
5959
"_extensions.post_process",
60+
"_extensions.rtd_patch",
6061
"_extensions.localization",
6162
]
6263

0 commit comments

Comments
 (0)