Skip to content

docs: fix mkdocs strict-mode failure on the-rules.md demo deep-links#39

Merged
raeq merged 1 commit into
mainfrom
docs-rules-mkdocs-links
May 20, 2026
Merged

docs: fix mkdocs strict-mode failure on the-rules.md demo deep-links#39
raeq merged 1 commit into
mainfrom
docs-rules-mkdocs-links

Conversation

@raeq

@raeq raeq commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

Hot-fix: docs/the-rules.md's First caught at deep-links use relative paths like ../demos/hello_led/README.md#a-shorted-supply, but mkdocs strict mode rejects relative links to files outside the docs/ tree. The docs deploy aborts on main with 8 warnings.

Switching the eight demo deep-links to absolute GitHub URLs — same pattern the doc already uses for the framework/errors.py source link. GitHub renders the same anchor algorithm for in-repo READMEs, so the links resolve on both the published docs site and on GitHub itself.

Test plan

  • uv run mkdocs build --strict — clean, no warnings
  • uv run pytest tests/docs/ — 34 passed (1 new: test_no_relative_demo_links_remain pins the convention so a future edit can't re-introduce the strict-mode failure)
  • uv run pytest — 4796 passed

Files

  • docs/the-rules.md — eight ../demos/<slug>/README.md#anchor links → https://github.com/raeq/wirebench/blob/main/demos/<slug>/README.md#anchor.
  • tests/docs/test_rules_doc.py — regex updated to match the absolute URL shape, plus a new test that asserts no relative ../demos/... links remain.

The Phase 2b.2 follow-up review changed *First caught at* links
from demo-folder roots to README#anchor deep-links so the rule
entries point at the specific near-miss snippet.  The new links
used relative paths (`../demos/<slug>/README.md#anchor`), but
mkdocs strict mode rejects relative links to files outside the
`docs/` tree (the README lives under `demos/`, which isn't a
mkdocs site file) — the docs deploy aborts with:

    WARNING - Doc file 'the-rules.md' contains a link
    '../demos/hello_led/README.md#a-shorted-supply', but the
    target '../demos/hello_led/README.md' is not found among
    documentation files.
    Aborted with 8 warnings in strict mode!

Switch the eight demo deep-links to absolute GitHub URLs —
same pattern this doc already uses for the
`src/framework/errors.py` source link.  GitHub renders the same
anchor algorithm for in-repo READMEs, so the deep-links resolve
on both the docs site and on GitHub itself.

Test coverage:
- `test_every_demo_cross_link_resolves` now matches the absolute
  URL shape and still verifies the README + heading anchor exist
  on disk.
- `test_no_relative_demo_links_remain` pins the convention so a
  future edit can't silently re-introduce the strict-mode failure.

mkdocs build --strict: clean.  Suite: 4796 passed.
Copilot AI review requested due to automatic review settings May 20, 2026 18:34

Copilot AI 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.

Pull request overview

This PR hot-fixes a docs build failure under MkDocs strict mode by replacing demo deep-links in docs/the-rules.md that pointed outside the docs/ tree with absolute GitHub URLs, and updates/extends the docs consistency tests to enforce the new convention.

Changes:

  • Replace eight ../demos/<slug>/README.md#... links in docs/the-rules.md with https://github.com/raeq/wirebench/blob/main/demos/<slug>/README.md#....
  • Update the existing cross-link resolver test to match the new absolute GitHub URL shape.
  • Add a new test to ensure no ../demos/... relative links remain in docs/the-rules.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/the-rules.md Switch demo “First caught at” deep-links to absolute GitHub URLs to satisfy MkDocs strict mode.
tests/docs/test_rules_doc.py Adjust regex to validate absolute GitHub demo README anchors and add a guard test preventing reintroduction of relative demo links.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@raeq raeq merged commit 372d3ab into main May 20, 2026
4 checks passed
@raeq raeq deleted the docs-rules-mkdocs-links branch May 20, 2026 18:44
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.

2 participants