Skip to content

Link the README's own files absolutely, kept local in the docs (issue btclib-org/.github#1851) - #481

Merged
fametrano merged 1 commit into
mainfrom
iss-1851-absolute-readme-links
Nov 7, 2026
Merged

fametrano merged 1 commit into
mainfrom
iss-1851-absolute-readme-links

Conversation

@fametrano

Copy link
Copy Markdown
Member

The README is the package's PyPI page, and PyPI does not resolve relative links, so its 10 links to the tree's own files were dead there. They now link absolutely to https://github.com/btclib-org/ecc/blob/main/<path>, as section 2 of the organization standard asks. Read the Docs keeps them local: RootFileLinks in docs/source/conf.py turns a BLOB link to an included file back into that page, as in the pilot. The hooks follow the standard: local-link-prefix exempts README.md, and readme-absolute-link refuses a relative link there. The pilot was PR btclib-org/bip39-slip39#224.

Evidence

Check Result
Suite, hooks exit 0; 15719 passed, coverage 100%
sphinx-build -n -W, href grep, check_included_links.py at 5be4b0f exit 0 each (control with the base conf.py: exit 1)
tests/docs_conf_test.py passes on the tip; 6 fail with the base conf.py
PyPI render, readme_renderer[md] 0 relative hrefs (base: 10)
Rebase case none: merge-tree with current origin/main exits 0
Local review dedicated reviewer CLEARED 995624f

The fresh review in the other client did not run. Codex answers: "ERROR: Your workspace is out of credits. Add credits to continue."

🤖 Generated with Claude Code

…tclib-org/.github#1851)

README.md is the package's page on PyPI, which resolves no relative
link against the tree, so its "./SECURITY.md" and the like were dead
there. Section 2 of the organization standard asks the root README.md
to link a file of its own tree as
https://github.com/btclib-org/ecc/blob/main/<path>, and its
`## Contributing` paragraph carries that form too.

The documentation renders some of those files as pages. RootFileLinks
in docs/source/conf.py now turns a link to BLOB plus the path of a file
a *_link.md shim includes, on any page, into the xref myst makes from a
relative link to that page, a fragment included, as
btclib-org/bip39-slip39#224 did there. A link to a file no shim
includes, such as ARCHITECTURE.md, stays a link to GitHub.
check_included_links.py, which docs.yml runs at its pin, refuses a
built page left linking an included file at BLOB.
tests/docs_conf_test.py runs the transform on hand-made doctrees; it
executes conf.py, so the `test` group gains sphinx, with the `docs`
group's marker and bound.

.pre-commit-config.yaml takes section 4's pair: `local-link-prefix`
excludes README.md, and `readme-absolute-link` refuses a relative link
there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ferdinando Ametrano <ferdinando@ametrano.net>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Documentation
    • Updated README links to point directly to the corresponding GitHub documents.
    • Documentation pages now resolve GitHub file links to included documents as in-page references, preserving link text and anchors. Links to files not included in the documentation remain external.
    • Added validation for links in the root README, allowing tree-relative paths without a ./ or ../ prefix.

The root README now uses absolute GitHub URLs for document links, and pre-commit checks its link destinations. The documentation transform converts qualifying GitHub BLOB links to included files into document cross-references. Tests cover these conversions and links that remain external.

Changes: README and documentation links

Layer / File(s) Summary
Root README link policy
.pre-commit-config.yaml, README.md
The pre-commit configuration adds a check for non-fragment, non-scheme links in the root README. Document links in the README now use absolute GitHub URLs.
GitHub BLOB link resolution
docs/source/conf.py, pyproject.toml, tests/docs_conf_test.py
RootFileLinks converts BLOB references to included files into document cross-references and preserves anchors and link content. Tests cover matching relative links, links to unincluded or nonexistent files, and links outside the configured BLOB prefix. The test dependency group adds a Python-version-marked Sphinx requirement.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested labels: dependencies, python:uv

Merge Risk: Minimal · up to 99562

No identified issue prevents merging after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title describes the main link changes and uses the standard's issue citation form. (github.com)
Description check Passed The description covers the README links, documentation transform, hooks, and tests.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c49be59 and 995624f.

Files ignored due to path filters: 1

  • uv.lock is excluded by !**/*.lock
Files selected for processing: 5

  • .pre-commit-config.yaml
  • README.md
  • docs/source/conf.py
  • pyproject.toml
  • tests/docs_conf_test.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Comment thread pyproject.toml Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 995624f

  • non-blocking: pyproject.toml:141. The comment says the test group's sphinx copies the marker and the bound of docs's (line 178), but no test keeps the two equal. tests/pyproject_test.py already has this kind of test for an extra and its group, so a row there would close it. The finding is left to the author.

Not checked: the readme-absolute-link pattern was not run, because grep -P was not available to me. A plain search found no relative link destination left in README.md. Also not run: the suite, sphinx-build -n -W, check_included_links.py and the readme_renderer render that the body cites.

@fametrano
fametrano merged commit f646b20 into main Nov 7, 2026
25 checks passed
@fametrano
fametrano deleted the iss-1851-absolute-readme-links branch November 7, 2026 01:36
fametrano added a commit to btclib-org/.github that referenced this pull request Nov 7, 2026
…2101)

btclib, btclib-secp256k1, bitcoin-core-rpc, btclib-wallet, ecc,
base58-bech32 and bip32-descriptors landed their README's absolute
links and section 4's `readme-absolute-link`:
btclib-org/btclib#2935, btclib-org/btclib-secp256k1#1335,
btclib-org/bitcoin-core-rpc#769, btclib-org/btclib-wallet#702,
btclib-org/ecc#481, btclib-org/base58-bech32#114 and
btclib-org/bip32-descriptors#96. On their main,
test_a_readme_opens_its_contributing_section_with_the_paragraph and
test_the_local_hooks_run pass and BACKLOG's strict rows report them as
XPASS(strict), so they leave both 1851 rows. btclib-node stays: its
pull request has not landed.

Signed-off-by: Ferdinando Ametrano <ferdinando@ametrano.net>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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