Documentation
¶
Overview ¶
Command linkcheck checks the relative links and #anchors of Markdown files offline: every relative link must name a file or directory that exists, and every anchor into a Markdown file must match one of its headings (GitHub's slug rules, including the -1, -2 suffixes of repeated headings) or an explicit <a name> or id. External URLs (any scheme, or //host) are out of scope.
Links are read from inline links and images, reference definitions and the href, src and srcset attributes of HTML, outside fenced code blocks and code spans.
Usage:
go run ./tools/linkcheck every tracked Markdown file except testdata go run ./tools/linkcheck FILE.md ... the named files
Exit codes: 0 every link resolves, 1 a broken link or anchor (each printed as "file:line: ..."), 2 usage error or an unreadable file.