From 6ad7c5d51aed522bd93e2757f01e634806960ebb Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sun, 19 Jun 2022 18:15:22 +0100 Subject: [PATCH] Tweak PEP references to work on topic sub-index pages --- pep_sphinx_extensions/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pep_sphinx_extensions/__init__.py b/pep_sphinx_extensions/__init__.py index d1726975a315..17ed80b2cb10 100644 --- a/pep_sphinx_extensions/__init__.py +++ b/pep_sphinx_extensions/__init__.py @@ -57,7 +57,7 @@ def _depart_maths(): def _update_config_for_builder(app: Sphinx) -> None: app.env.document_ids = {} # For PEPReferenceRoleTitleText if app.builder.name == "dirhtml": - app.env.settings["pep_url"] = "../pep-{:0>4}" + app.env.settings["pep_url"] = "/pep-{:0>4}" # internal_builder exists if Sphinx is run by build.py if "internal_builder" not in app.tags: @@ -77,7 +77,7 @@ def _post_build(app: Sphinx, exception: Exception | None) -> None: def setup(app: Sphinx) -> dict[str, bool]: """Initialize Sphinx extension.""" - environment.default_settings["pep_url"] = "pep-{:0>4}.html" + environment.default_settings["pep_url"] = "/pep-{:0>4}.html" environment.default_settings["halt_level"] = 2 # Fail on Docutils warning # Register plugin logic