From dbe0dd8c4f8c68f8fa43043b72f19fe3afd5840e Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 1 Sep 2023 05:57:00 +0100 Subject: [PATCH] Ensure the ``:pep:`` role works properly with the dirhtml builder (#3322) --- pep_sphinx_extensions/__init__.py | 2 +- pep_sphinx_extensions/pep_zero_generator/writer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pep_sphinx_extensions/__init__.py b/pep_sphinx_extensions/__init__.py index 672a6a452eb..8538b838a98 100644 --- a/pep_sphinx_extensions/__init__.py +++ b/pep_sphinx_extensions/__init__.py @@ -28,7 +28,7 @@ def _update_config_for_builder(app: Sphinx) -> None: app.env.document_ids = {} # For PEPReferenceRoleTitleText app.env.settings["builder"] = app.builder.name if app.builder.name == "dirhtml": - app.env.settings["pep_url"] = "pep-{:0>4}" + app.env.settings["pep_url"] = "pep-{:0>4}/" app.connect("build-finished", _post_build) # Post-build tasks diff --git a/pep_sphinx_extensions/pep_zero_generator/writer.py b/pep_sphinx_extensions/pep_zero_generator/writer.py index b6171f7312e..cfb8e864e2f 100644 --- a/pep_sphinx_extensions/pep_zero_generator/writer.py +++ b/pep_sphinx_extensions/pep_zero_generator/writer.py @@ -149,7 +149,7 @@ def write_pep0( target = ( f"topic/{subindex}.html" if builder == "html" - else f"../topic/{subindex}" + else f"../topic/{subindex}/" ) self.emit_text(f"* `{subindex.title()} PEPs <{target}>`_") self.emit_newline()