Skip to content

docs: point the source links at something the published site can reach - #4

Open
egeboy35 wants to merge 1 commit into
lkk688:mainfrom
egeboy35:docs/fix-links-that-escape-the-site
Open

docs: point the source links at something the published site can reach#4
egeboy35 wants to merge 1 commit into
lkk688:mainfrom
egeboy35:docs/fix-links-that-escape-the-site

Conversation

@egeboy35

Copy link
Copy Markdown

.github/workflows/deploy-docs.yml runs mkdocs gh-deploy on every push to main, and mkdocs serves docs/ alone. So a link like

[tools.py](../../edgeLLM/edge_agent/src/edge_agent/tools.py)

from docs/curriculum/ leaves the site and 404s for every reader — while resolving perfectly for anyone browsing the repository locally, which is why it survives review.

mkdocs build on main says so itself: 90 warnings, all of this shape, across 14 documents.

The repo already does it the working way

In these same pages:

[`tools.py`](https://github.com/lkk688/edgeAI/blob/main/edgeLLM/edge_agent/src/edge_agent/tools.py)

This makes 84 more links consistent with that, across 7 documents. Every rewritten target was checked to exist in the tree first.

mkdocs build warnings:  90 -> 23

What I left alone, and why

22 of the 23 remaining are links whose target is under jetson/ or raspberrypi/. I have no Jetson and have run nothing in those directories, so I would rather not edit pages whose surrounding claims I cannot check. They are the same one-line change if you want them — the test names those two prefixes as an explicit exception rather than skipping them silently, so re-fixing them later flips a list entry instead of a rule.

The 23rd points at curriculum/11_final_challenges_hackathon.md, which does not exist anywhere in the repository. The curriculum runs 10, 11, 11b, 12… so it looks renamed or dropped, and I did not want to guess which.

Two things I caught in my own first pass and did not send

  • The first version rewrote 111 links, 26 of which pointed at pages and figures inside docs/. Those already resolve, and turning a docs/figures/*.JPG link into a blob URL would have replaced working images with links to GitHub's file viewer. The rewrite now skips anything under docs/.
  • I had also written a test asserting that no blob URL points back into docs/. It fails on main, on a line this change does not touch: 00b_sjsujetsontool_cheatsheet.md:3 has linked to blob/main/docs/curriculum/00_sjsujetsontool_guide.md since before this branch. That is a rule I invented rather than a defect I measured, so the test is gone.

Tests

Adds tests/test_docs_links.py — 6 tests, standard library only, no network: the GitHub URLs are checked against the working tree rather than fetched.

Against this branch: 6 passed. Against docs/ as it stands on main: 4 failed, 2 passed:

FAILED test_no_relative_link_escapes_the_published_site
FAILED test_the_heaviest_pages_carry_no_escaping_link[11_nextjs_nemotron_app.md]
FAILED test_the_heaviest_pages_carry_no_escaping_link[11b_nextjs_agent_lab.md]
FAILED test_the_heaviest_pages_carry_no_escaping_link[13_react_agent.md]

All four fail on behaviour; this suite adds no symbol of its own to assert on.

pytest tests/test_docs_links.py
mkdocs build          # 90 warnings before, 23 after

@egeboy35
egeboy35 force-pushed the docs/fix-links-that-escape-the-site branch from b8ec265 to e88f6ee Compare September 1, 2026 12:28
.github/workflows/deploy-docs.yml runs `mkdocs gh-deploy` on every push to
main, and mkdocs serves docs/ alone. A link like

    [tools.py](../../edgeLLM/edge_agent/src/edge_agent/tools.py)

from docs/curriculum/ therefore leaves the site and 404s for every reader,
while resolving perfectly for anyone browsing the repository locally -- which
is why it survives review.

`mkdocs build` on main says so itself: 90 warnings, all of this shape, across
14 documents.

The repository already links to source files the way that works, in these same
pages:

    [`tools.py`](https://github.com/lkk688/edgeAI/blob/main/edgeLLM/edge_agent/src/edge_agent/tools.py)

This makes 84 more links consistent with that, across 7 documents. Every
rewritten target was checked to exist in the tree first.

    mkdocs build warnings:  90 -> 23

Twenty-two of the 23 that remain are links whose target is under jetson/ or
raspberrypi/. I left those alone deliberately: I have no Jetson and have not
run anything in those directories, so I would rather not touch pages I cannot
check the surrounding claims of. They are the same one-line change if you want
them. The 23rd points at curriculum/11_final_challenges_hackathon.md, which
does not exist anywhere in the repository -- the curriculum runs 10, 11, 11b,
12... so it looks renamed or dropped, and I did not want to guess which.

Two things I caught in my own first pass and did not send:

  * The first version rewrote 111 links, 26 of which pointed at pages and
    figures *inside* docs/. Those already resolve, and turning a
    docs/figures/*.JPG link into a blob URL would have replaced working images
    with links to GitHub's file viewer. The rewrite now skips anything under
    docs/.
  * I had also written a test asserting no blob URL points back into docs/.
    It fails on main, on a line this change does not touch --
    00b_sjsujetsontool_cheatsheet.md:3 has linked to
    blob/main/docs/curriculum/00_sjsujetsontool_guide.md since before this
    branch. That is a rule I invented rather than a defect I measured, so the
    test is gone.

Adds tests/test_docs_links.py -- 6 tests, standard library only, no network:
the GitHub URLs are checked against the working tree rather than fetched.
Against this branch: 6 passed. Against docs/ as it stands on main: 4 failed,
2 passed --

    FAILED test_no_relative_link_escapes_the_published_site
    FAILED test_the_heaviest_pages_carry_no_escaping_link[11_nextjs_nemotron_app.md]
    FAILED test_the_heaviest_pages_carry_no_escaping_link[11b_nextjs_agent_lab.md]
    FAILED test_the_heaviest_pages_carry_no_escaping_link[13_react_agent.md]

all four on behaviour; the suite adds no symbol to assert on. The jetson and
raspberrypi prefixes are a named exception in the test rather than a silent
skip, so re-fixing them later flips a list entry instead of a rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@egeboy35
egeboy35 force-pushed the docs/fix-links-that-escape-the-site branch from e88f6ee to 2cb59f5 Compare September 1, 2026 12:43
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