Skip to content

Check anchors, and the links in admonitions and tabs, with lychee - #41

Merged
patrick-5546 merged 2 commits into
mainfrom
lychee-anchors
Dec 3, 2026
Merged

patrick-5546 merged 2 commits into
mainfrom
lychee-anchors

Conversation

@patrick-5546

@patrick-5546 patrick-5546 commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

lychee now checks each link's anchor, and the links inside admonitions and content tabs, which it skipped before.

Changes

  1. Links in admonitions and content tabs: lychee reads Markdown as CommonMark, so it took their four-space-indented content for code blocks and skipped their links. Two links were hidden this way. One of them, the panes link on the Windows Terminal page, redirected permanently from docs.microsoft.com, so Update links that redirect, fill the glossary's gaps, and drop revision dates #37 missed it. It now points to learn.microsoft.com, as the page's other links do.
    • include_verbatim = true checks the links in code as well. The only addition besides those two is the README's git clone URL.
    • exclude_loopback = true skips the README's preview address, http://localhost:8000.
  2. Anchors: include_fragments = "full" checks that each link's anchor is on its page, along with the text of the one text fragment (#:~:text=), on the Atlassian rebase page. The strict build already checks the anchors in links between pages.
  3. make links installs only lychee: uv run --only-group links. Before, --group links also installed the project and the dev group. That includes actionlint-py, which uv builds from source by downloading actionlint, so a failed download, after an update empties the cache, could have failed the weekly check.

Not changed, and why

  • No GitHub token. Move the site to Zensical, and modernize its tooling #34 removed it, and lychee's source confirms why (check_github in lychee-lib/src/checker/website.rs). lychee uses the token only after a request fails, to ask GitHub's API whether the repository exists. For a link with a path, such as a file page, it still reports the failure. The throttling and accepted 429/503 already cover the rate limits.
  • No job summary. The step's log already lists each broken link, with its file and line.

Verification

  • make lint and make build pass.
  • Run without the cache, make links reports 235 links, 225 unique: 232 OK, 0 errors and 3 excluded (two LinkedIn profiles and the preview address). The only redirect left is the git clone URL, notes.git, which is right for git clone.
  • Stack Overflow answers with 403 here too, which accept allows, so its 7 links still aren't really checked.
  • The Links workflow runs on this PR, since lychee.toml changes.

lychee reads Markdown as CommonMark, so the four-space-indented content of admonitions and content
tabs was code to it, and their links went unchecked. One of them redirected permanently from
docs.microsoft.com to learn.microsoft.com. lychee now also checks the links in code, apart from the
local preview address, and each link's anchor or text fragment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@patrick-5546 patrick-5546 added the infrastructure Infrastructure updates label Dec 3, 2026
uv run --group links also installed the project and the dev group, including actionlint-py, which
uv builds from source by downloading actionlint. A failed download there would fail the weekly link
check, so the task now installs the links group alone.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@patrick-5546 patrick-5546 left a comment •

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Should an issue be files for lychee not treating admonitions and content tabs? Like adding python markdown support? Is 4 space indent the proper syntax for admonitions and content tabs? Are all of the setting adding for lychee non-default?

@patrick-5546

Copy link
Copy Markdown
Owner Author

Answers to your review:

@patrick-5546
patrick-5546 merged commit a64fd73 into main Dec 3, 2026
3 checks passed
@patrick-5546
patrick-5546 deleted the lychee-anchors branch December 3, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Infrastructure updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant