From ef9f698e04211281c803a67f3480835f62aae3ee Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 30 Oct 2024 14:15:36 +0200 Subject: [PATCH] doc: Create html_context before setting READTHEDOCS Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file exec(code, namespace) # NoQA: S102 ^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/checkouts/latest/doc/user/conf.py", line 77, in html_context["READTHEDOCS"] = True ^^^^^^^^^^^^ NameError: name 'html_context' is not defined Signed-off-by: Donatas Abraitis --- doc/developer/conf.py | 1 + doc/user/conf.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/developer/conf.py b/doc/developer/conf.py index 634f4aa80420..a5b514814080 100644 --- a/doc/developer/conf.py +++ b/doc/developer/conf.py @@ -71,6 +71,7 @@ html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") # Tell Jinja2 templates the build is running on Read the Docs +html_context = {} if os.environ.get("READTHEDOCS", "") == "True": html_context["READTHEDOCS"] = True diff --git a/doc/user/conf.py b/doc/user/conf.py index 236a90e9026b..f9f178f5ff1c 100644 --- a/doc/user/conf.py +++ b/doc/user/conf.py @@ -73,11 +73,11 @@ html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") # Tell Jinja2 templates the build is running on Read the Docs +html_context = {} if os.environ.get("READTHEDOCS", "") == "True": html_context["READTHEDOCS"] = True - # ----------------------------------------------------------------------------- # Extract values from codebase for substitution into docs. # -----------------------------------------------------------------------------