Skip to content

docs: make the README's links absolute so they work on PyPI - #97

Merged
JeanExtreme002 merged 2 commits into
mainfrom
docs/readme-absolute-links
Sep 8, 2026
Merged

docs: make the README's links absolute so they work on PyPI#97
JeanExtreme002 merged 2 commits into
mainfrom
docs/readme-absolute-links

Conversation

@JeanExtreme002

@JeanExtreme002 JeanExtreme002 commented Sep 8, 2026

Copy link
Copy Markdown
Owner

The README is the package'"'"'s long_description (readme = "README.md" in
pyproject.toml), so PyPI renders it — and relative links there resolve against
pypi.org, which has no docs/ tree. Every documentation link on the project
page navigates to something that does not exist.

What was measured

Rendering the README through readme_renderer, the library PyPI uses:

  • 13 relative hrefs survive into the published HTML — the whole
    documentation table, plus CONTRIBUTING.md and LICENSE.

After the change: 0 relative paths, and all 18 absolute URLs verified to
resolve
.

Choices behind the targets

Documentation → Read the Docs. A reader arriving from PyPI gets the
rendered site rather than raw Markdown. docs/contributing.md and
docs/license.md include the root files, so the content matches either way.

en/latest, not en/stable — there is no stable alias configured on the
project (it 404s).

CONTRIBUTING.md and LICENSE → GitHub, which is where you act on them.

The in-page anchor stays relative. It was absolutised in the first commit
and reverted in the second: a relative path on PyPI navigates somewhere
wrong, but a relative fragment with no matching id is merely inert — the
browser stays put, nothing errors. Absolutising it would have charged the
majority of readers, turning an in-page jump on GitHub into a full navigation
that reloads the same page.

Scope

Only README.md. Relative links inside docs/ are correct as they stand:
MyST rewrites .md to .html at build time, so they work both on GitHub and
on the site. Hardcoding absolute URLs there would break local previews and
send a reader on a pinned version off to /en/latest/.

`readme = "README.md"` in pyproject.toml, so this file is the package's
long_description and PyPI renders it. Relative links there resolve against
pypi.org, which has no `docs/` tree — every documentation link on the project
page was dead.

Rendered through `readme_renderer`, exactly as PyPI does, 13 relative hrefs
survived into the published HTML. The in-page anchor was a 14th: the renderer
emits no heading ids at all (0 of them, measured), so `#let-an-ai-assistant-
do-it-mcp` went nowhere.

Documentation pages point at Read the Docs rather than GitHub blobs — a reader
arriving from PyPI gets the rendered site instead of raw Markdown, and
`docs/contributing.md` and `docs/license.md` include the root files anyway.
`en/latest`, not `en/stable`: there is no stable alias configured (404).
CONTRIBUTING.md and LICENSE stay on GitHub, which is where you act on them.

Only README.md is touched. Relative links inside `docs/` are correct as they
are — MyST rewrites `.md` to `.html` when it builds, so they work both on
GitHub and on the site, and hardcoding absolute URLs there would break local
previews and send a reader on a pinned version to `/en/latest/`.

All 18 URLs in the rendered README verified to resolve.
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.89%. Comparing base (f9a5ff6) to head (44056f7).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #97   +/-   ##
=======================================
  Coverage   89.89%   89.89%           
=======================================
  Files          41       41           
  Lines        3632     3632           
=======================================
  Hits         3265     3265           
  Misses        367      367           
Flag Coverage Δ
Linux-py3.10 64.94% <ø> (ø)
Linux-py3.11 64.94% <ø> (ø)
Linux-py3.12 64.94% <ø> (ø)
Linux-py3.13 64.94% <ø> (ø)
Windows-py3.10 66.51% <ø> (ø)
Windows-py3.11 66.51% <ø> (ø)
Windows-py3.12 66.51% <ø> (ø)
Windows-py3.13 66.51% <ø> (ø)
macOS-py3.12 87.22% <ø> (ø)
mcp-Linux-py3.12 91.42% <ø> (ø)
mcp-Windows-py3.12 91.63% <ø> (ø)
mcp-macOS-py3.12 91.52% <ø> (ø)
speed-Linux-py3.12 66.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Reverts one line of the previous commit. The anchor was bundled in because it
matched the pattern — a relative link — without weighing that its failure mode
is different in kind.

A relative *path* on PyPI navigates somewhere wrong:
`pypi.org/project/PyMemoryEditor/docs/mcp.md` does not exist. A relative
*fragment* whose id is missing is inert — the browser stays where it is.
Nothing errors and nothing goes to the wrong place; the click just does not
respond.

Against that, absolutising it charged the majority of readers: on GitHub the
anchor was an in-page jump and became a full navigation to github.com,
reloading the same page to reach a section already on screen.

So the mild PyPI cost stays, and the GitHub reader keeps the jump.
@JeanExtreme002
JeanExtreme002 merged commit f6d2084 into main Sep 8, 2026
20 checks passed
@github-actions
github-actions Bot deleted the docs/readme-absolute-links branch September 8, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant