Skip to content

Add lychee link-check recipes to justfile#654

Open
ecomodeller wants to merge 1 commit into
mainfrom
docs-linkcheck-lychee
Open

Add lychee link-check recipes to justfile#654
ecomodeller wants to merge 1 commit into
mainfrom
docs-linkcheck-lychee

Conversation

@ecomodeller
Copy link
Copy Markdown
Member

Summary

A full just docs render takes minutes, so iterating on broken links is slow. This adds three lychee recipes that give faster feedback:

  • just linkcheck.qmd sources, offline. Useful as a quick sanity check while writing prose; ~20ms locally. Does not see Quarto cross-refs like [foo](`modelskill.X`) since those aren't standard markdown.
  • just linkcheck-site — renders the docs with quarto render --no-execute (a new docs-fast recipe; skips Python execution) and runs lychee against the resulting _site/. This is where quartodoc-generated cross-refs and anchors actually become checkable. Locally finds hundreds of real broken refs in the current site in ~85ms.
  • just linkcheck-online.qmd sources + external URLs.

Install instructions for lychee are added to CONTRIBUTING.

Limitations

Lychee verifies that link targets exist, not that they are semantically correct. A link whose text describes "Observation" but whose target is a (real) ModelResult page will pass — that class of bug still needs human review.

Test plan

  • just linkcheck runs and exits 0 against current .qmd sources
  • just linkcheck-site builds via --no-execute and surfaces existing broken refs in the rendered site
  • just --list shows the new recipes with descriptions

A full quarto render takes minutes, so iterating on broken links is
painful. Add three `just` recipes backed by lychee:

- `linkcheck` checks .qmd sources offline (fast, no render).
- `linkcheck-site` renders with `--no-execute` (skips Python cells) and
  checks the resulting `_site/`. Catches quartodoc-generated cross-refs
  and missing anchors that source-only checks can't see.
- `linkcheck-online` adds external URL checks.

Document the install in CONTRIBUTING.
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