]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
docs: Add readthedocs configuration 3420/head
authorBen Darnell <ben@bendarnell.com>
Wed, 4 Sep 2024 19:14:30 +0000 (15:14 -0400)
committerBen Darnell <ben@bendarnell.com>
Wed, 4 Sep 2024 19:14:30 +0000 (15:14 -0400)
RTD will no longer do this automagically, so we need to add these
lines explicitly for compatibility. See
https://about.readthedocs.com/blog/2024/07/addons-by-default/

docs/conf.py

index bb3705873e84374a0e4c41d316f1ead963877bf6..c2c81b5f0711dcea52b57706f047bd487a6eef45 100644 (file)
@@ -146,3 +146,16 @@ def missing_reference_handler(app, env, node, contnode):
 
 def setup(app):
     app.connect("missing-reference", missing_reference_handler)
+
+
+# Read the Docs configuration updates from
+# https://about.readthedocs.com/blog/2024/07/addons-by-default/
+
+# Define the canonical URL if you are using a custom domain on Read the Docs
+html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
+
+# Tell Jinja2 templates the build is running on Read the Docs
+if os.environ.get("READTHEDOCS", "") == "True":
+    if "html_context" not in globals():
+        html_context = {}
+    html_context["READTHEDOCS"] = True