Skip to content

Commit fffc1c2

Browse files
authored
Merge pull request #3691 from effigies/doc/readthedocs-compat
DOC: Patch doc/conf.py to work with latest ReadTheDocs
2 parents ae12343 + 86e10d3 commit fffc1c2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: doc/conf.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
import nipype
2020
import subprocess as sp
2121

22+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
23+
24+
# Tell Jinja2 templates the build is running on Read the Docs
25+
if os.environ.get("READTHEDOCS", "") == "True":
26+
if "html_context" not in globals():
27+
html_context = {}
28+
html_context["READTHEDOCS"] = True
29+
2230
# Disable etelemetry during doc builds
2331
os.environ["NIPYPE_NO_ET"] = "1"
2432

@@ -132,10 +140,6 @@
132140
]
133141

134142

135-
on_rtd = os.environ.get("READTHEDOCS") == "True"
136-
if on_rtd:
137-
extensions.append("readthedocs_ext.readthedocs")
138-
139143
# Add any paths that contain templates here, relative to this directory.
140144
templates_path = ["_templates"]
141145

0 commit comments

Comments
 (0)