Ensure the ``:pep:`` role works properly with the dirhtml builder (#3322)

This commit is contained in:
Adam Turner 2023-09-01 05:57:00 +01:00 committed by GitHub
parent 43a28ef8b4
commit dbe0dd8c4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ def _update_config_for_builder(app: Sphinx) -> None:
app.env.document_ids = {} # For PEPReferenceRoleTitleText app.env.document_ids = {} # For PEPReferenceRoleTitleText
app.env.settings["builder"] = app.builder.name app.env.settings["builder"] = app.builder.name
if app.builder.name == "dirhtml": 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 app.connect("build-finished", _post_build) # Post-build tasks

View File

@ -149,7 +149,7 @@ class PEPZeroWriter:
target = ( target = (
f"topic/{subindex}.html" f"topic/{subindex}.html"
if builder == "html" if builder == "html"
else f"../topic/{subindex}" else f"../topic/{subindex}/"
) )
self.emit_text(f"* `{subindex.title()} PEPs <{target}>`_") self.emit_text(f"* `{subindex.title()} PEPs <{target}>`_")
self.emit_newline() self.emit_newline()