]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
doc: enable ReadTheDocs addon management
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 16 Jul 2024 19:04:23 +0000 (21:04 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 19 Jul 2024 11:46:29 +0000 (13:46 +0200)
Up to now ReadTheDocs has been injecting code when building on their
platform. This includes for instance improvements for the search function.

To maintain the current output ReadTheDocs requires setting html_baseurl
and html_context in conf.py.

See: https://about.readthedocs.com/blog/2024/07/addons-by-default/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
doc/conf.py

index c9138a5a5d4887b4a541e46aafab25c7377bee6a..e79134cc3d7583f0ef3c0600534164f984499a8b 100644 (file)
@@ -21,6 +21,12 @@ from subprocess import check_output
 # Get Sphinx version
 major, minor, patch = sphinx.version_info[:3]
 
+# Set canonical URL from the Read the Docs Domain
+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":
+    html_context["READTHEDOCS"] = True
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the