Skip to content

Commit

Permalink
Tweak PEP references to work on topic sub-index pages
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Jun 19, 2022
1 parent b4032e7 commit 6ad7c5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pep_sphinx_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 6ad7c5d

Please sign in to comment.