diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f300026..83bdc4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,3 +25,21 @@ jobs: for f in docs/migrate/*.sh; do cmp "$f" "site/migrate/$(basename "$f")" done + # Anchors come from heading text, so an edited heading breaks every link + # pointing at it, including links on pages nobody touched. + # + # mkdocs has validation.links.anchors and it is not enabled here, which + # looks like the cheaper option until you check what it covers. It reads + # source markdown; this reads built HTML. Measured on this site: a raw + # and a root-absolute link, both pointing at headings that do + # not exist, pass mkdocs and fail here. + # + # print_page/ is the single-page export from mkdocs-print-site-plugin. It + # rewrites every fragment into ids of its own, so its anchors are not the + # site's. All 690 links the exclusion drops are page-local fragments of + # that generated page; no authored link is silenced. + # + # Last, because it is the step most likely to go red and a job stops at + # its first failure. + - name: Check anchors + run: uv run check-anchors site --exclude 'print_page/*' diff --git a/pyproject.toml b/pyproject.toml index a065557..cfa5af2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,4 +8,5 @@ dependencies = [ "mkdocs-with-pdf>=0.9", "click<8.3", "mkdocs-print-site-plugin>=2.8", + "halos-docs-tools @ git+https://github.com/halos-org/docs-tools@v0.1.0", ] diff --git a/uv.lock b/uv.lock index dcdbed7..73b086c 100644 --- a/uv.lock +++ b/uv.lock @@ -375,6 +375,7 @@ version = "0.1.0" source = { virtual = "." } dependencies = [ { name = "click" }, + { name = "halos-docs-tools" }, { name = "mkdocs-material" }, { name = "mkdocs-print-site-plugin" }, { name = "mkdocs-with-pdf" }, @@ -383,11 +384,20 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "click", specifier = "<8.3" }, + { name = "halos-docs-tools", git = "https://github.com/halos-org/docs-tools?rev=v0.1.0" }, { name = "mkdocs-material", specifier = ">=9.5" }, { name = "mkdocs-print-site-plugin", specifier = ">=2.8" }, { name = "mkdocs-with-pdf", specifier = ">=0.9" }, ] +[[package]] +name = "halos-docs-tools" +version = "0.1.0" +source = { git = "https://github.com/halos-org/docs-tools?rev=v0.1.0#7f09d05f54cf64184a7a4d7205c166bc49ec0f6e" } +dependencies = [ + { name = "pyyaml" }, +] + [[package]] name = "idna" version = "3.11"