D0008 nav-entries¶
Rule: The book's navigation names pages that exist.
| Code | D0008 (stable, never reused) |
| Id | nav-entries |
| Category | book |
| Source | spirit_level |
| Fix | by hand |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | deny |
a navigation entry that names no page renders as a link that leads nowhere, and the build does not fail |
| small-workspace | deny |
a navigation entry that names no page renders as a link that leads nowhere, and the build does not fail |
| medium | deny |
a navigation entry that names no page renders as a link that leads nowhere, and the build does not fail |
| big | deny |
a navigation entry that names no page renders as a link that leads nowhere, and the build does not fail |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
Zensical treats a navigation entry that does not resolve to a page as a link to an external site. A misspelled or moved page in nav does not fail the build: the navigation shows a link that leads nowhere.
The lint checks every entry of nav that is not a URL: it must name a file in the docs folder. It reads zensical.toml, or mkdocs.yml for a book Zensical builds from a legacy MkDocs project (Zensical reads it unchanged): the same check, either format.
How to fix¶
Correct the path. Paths in nav are relative to the docs folder (docs_dir, docs by default). Drop the entry if the page is gone.
Configure¶
Allow one finding in the code with // spirit-level: allow(nav-entries) <reason> (waivers); the code works there too, as in [lints.D0008].