docs: fail docs build on warnings (#3707)

## Summary

- run the existing MkDocs deployment build in strict mode
- turn documentation warnings, including unresolved references, into CI
failures instead of deploying them

## Why

The docs workflow currently completes when MkDocs emits warnings. Using
MkDocs' built-in strict mode makes the deployment stop on those warnings
and surfaces documentation problems immediately. This addresses the
warning-detection portion of #572 without adding another dependency or
duplicating the docs build.

## Validation

- `git diff --check`
- parsed `.github/workflows/docs.yml` with PyYAML
- full `mkdocs build --strict` was not run locally because MkDocs is not
installed; the existing docs workflow has the required dependencies

---------

Co-authored-by: Will Jones <willjones127@gmail.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Sushanth012
2026-12-02 02:03:26 +08:00
committed by GitHub
co-authored by Will Jones Xuanwo
parent a0ff67e13e
commit 193c9d8e2e
15 changed files with 75 additions and 41 deletions
+6
View File
@@ -59,6 +59,12 @@ function processContents(contents) {
});
return lines.join("\n") + "\n\n";
})
// Escape array suffixes that MkDocs could read as reference links.
// Preserve the contents of fenced blocks and inline code spans.
.replace(
/^(`{3,})[^\n]*\n[\s\S]*?^\1[ \t]*$|(`+).*?\2|(?<=\])\[\]/gm,
(match) => (match === "[]" ? "&#91;&#93;" : match),
)
// Also trim trailing whitespace
.replace(/([^ \t])[ \t]+\n/g, "$1\n")
);