Repository navigation
📝 docs: fix trailing-slash links left by the Sphinx move - #1986
Merged
Merged
Conversation
MkDocs served every page as a directory, so a link to one ended in a slash. pypa#1957 moved the site to Sphinx, which emits <page>.html, and Read the Docs serves the built tree as is, so the old shape 404s. Seven links in tracked files still use it. The one reported in pypa#1980 is the `Release Notes` entry in `pyproject.toml`, which is what PyPI renders in the project sidebar; the rest are four links in `docs/README.md`, which is the long description shown on the same page, and the contributor-guide link in `.github/CONTRIBUTING.md` and the pull request template. Checked against the live site rather than assumed: `/latest/changelog.html` and `/stable/how-to/install-pipx.html` answer 200, `/latest/changelog/` answers 404. `tests/test_docs_urls.py` scans tracked documentation and `pyproject.toml` for the MkDocs page shape so the pattern cannot come back. It reads the tree with pathlib rather than shelling out, so it needs neither git on PATH nor the package cache, and its terminator set covers a bare URL, a markdown link and a quoted value — the last one because the reported link lives in a TOML string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1980.
The
Release Noteslink inpyproject.tomlis the one @kevinbowen777 reported, and it turned out not to be alone — the same MkDocs directory-URL shape survives in six more places. MkDocs served every page as a directory, so a link to one ended in a slash; #1957 moved the site to Sphinx, which emits<page>.html, and Read the Docs serves the built tree as is.All seven, found by scanning rather than by eye:
pyproject.tomlanddocs/README.mdboth feed the PyPI project page — the sidebar link and the long description respectively — so five of the seven are visible to anyone who lands there.Checked against the live site rather than assumed:
/latest/changelog.htmland/stable/how-to/install-pipx.htmlanswer 200,/latest/changelog/answers 404.The test
tests/test_docs_urls.pyscans tracked documentation andpyproject.tomlfor the old shape so it cannot come back. Two notes on how it is built, since both were mistakes I made first:pathlibinstead of shelling out togit ls-files. Asubprocesscall needs git onPATH, which is not guaranteed for whoever runs the suite.pyproject.tomlis inside a TOML string and ends at a".It needs neither network nor the package cache, so it runs anywhere the suite runs.
changelog.d/