[PATCH 1/1] doc: enable ReadTheDocs addon management

Tom Rini trini at konsulko.com
Tue Jul 16 21:07:12 CEST 2024


On Tue, Jul 16, 2024 at 09:04:23PM +0200, Heinrich Schuchardt wrote:

> 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 at canonical.com>
> ---
>  doc/conf.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/doc/conf.py b/doc/conf.py
> index c9138a5a5d4..e79134cc3d7 100644
> --- a/doc/conf.py
> +++ b/doc/conf.py
> @@ -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

Thanks for taking care of this!

Reviewed-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240716/2c4ec7fd/attachment.sig>


More information about the U-Boot mailing list