THE GITHTML FIELD GUIDE

Use MkDocs strict builds to investigate documentation warnings

Run a local MkDocs build in strict mode to make configured warnings fail the review, then investigate each diagnostic by its source and consequence. Strict mode is useful only when the validation policy matches the project. Do not suppress all warnings to obtain a clean exit; distinguish broken references from intentional omissions and documented exceptions.

Understand which diagnostics your configuration emits

Before enabling strict mode, inspect the current MkDocs version and validation settings. Different diagnostic categories may be configured as warnings, informational messages, or ignored conditions. Strict mode does not magically turn every possible documentation defect into a check. Start with the current local build log and classify each message: missing source, unresolved link, omitted navigation item, or another issue. Identify whether the consequence affects readers or reflects an intentional project choice. Keep the classification with the review notes so a later maintainer can understand why an exception exists rather than assuming every warning was equally serious.

Fix a small batch and rerun the same command

Run the command below from the project directory using the project's approved environment. Work on one diagnostic category at a time and preserve unrelated content edits. For a broken link, compare the source path with the generated route before changing either. For an intentionally unlisted page, use the documented configuration for that intent instead of disabling all navigation validation. Do not delete a page merely to eliminate an omitted-file message. The page may still serve a real reader need. Capture the exact command and exit result so another reviewer can repeat the check without depending on your terminal history.

sh
mkdocs --version
mkdocs build --strict

Keep exceptions narrow and reviewed

An exception should identify the affected file or condition, explain why it is intentional, and have an owner or review trigger. Broad suppression hides future mistakes unrelated to the original issue. After the build passes, open representative pages and follow the repaired links; a clean log cannot establish that the prose or navigation labels are accurate. Re-run strict checks when upgrading MkDocs or changing extensions because diagnostic behavior can change. Keep this verification local and independent of any hosted workflow. The useful outcome is a documented validation policy and a repeatable review command, not a green status obtained by reducing the amount of checking. When sharing the result, include unresolved informational findings too if they affect the reading experience. An exit code answers a configured policy question, not every question a documentation reviewer should ask.

  1. Record the installed version and inspect which validation categories are warnings.
  2. Classify diagnostics before editing source or configuration.
  3. Fix one cause at a time and rerun the identical local strict command.
  4. Keep exceptions narrow, justified, and paired with a review trigger.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All documentation builds and formats guides →

Read as MarkdownAll guides

Use MkDocs strict builds to investigate documentation warnings · gitHtml