Skip to content

Documentation tooling defect patterns

This page lists defects in ConnectSoft documentation sites built with MkDocs and Material. Each one leaves the site visibly wrong while mkdocs build --strict reports success, or while the person running it believes it did. Each pattern names the symptom, the cause, what to look for in a review, and how to prove the site is sound. The rules these patterns break are on the documentation writing standard page.

CS-DP-DOCS-001: Strict build passes a link to a missing anchor

Severity: minor · Applies to: docs, template · Enforced by: manual · Status: active

Symptom

Links to a section of a page land at the top of the page, or nowhere, and mkdocs build --strict passes.

Cause

By default, MkDocs checks that a linked page exists, not that the #anchor in the link exists on it. The site configuration has no validation: block that turns on anchor checks.

Check

  • A mkdocs.yml without validation: links: anchors: warn.
  • New ](#...) and ](page.md#...) links in a site that does not validate anchors.

Test

Turn on anchor validation and run the strict build, or compare each link anchor with the ids in the built HTML.

CS-DOCS-008, CS-DOCS-004

CS-DP-DOCS-002: Heading anchor that does not end the line is ignored

Severity: minor · Applies to: docs · Enforced by: manual · Status: active

Symptom

The heading shows {#anchor} as literal text, and inbound links to that anchor point at nothing.

Cause

The attribute list extension honours { #anchor } only when it ends the heading line. Any text after it, such as a status marker or an emoji, makes the braces literal, and the heading gets an automatic id instead.

Check

Headings with text after the { #... } block.

Test

Search the built page for id="<anchor>", or run a strict build with anchor validation turned on.

CS-DOCS-008, CS-DOCS-004

Rendering

CS-DP-DOCS-003: Strict build never checks diagram syntax

Severity: minor · Applies to: docs · Enforced by: manual · Status: active

Symptom

Pages of a site whose strict build is clean show "Syntax error" in place of a diagram.

Cause

MkDocs does not parse Mermaid; the browser does, when the page loads. Common causes:

  • ; in sequence diagram messages, notes and alt, else or loop labels;
  • unquoted ( ) " < > or backticks in flowchart node labels;
  • a %% comment at the end of a diagram line;
  • reserved words, such as style, used as node ids;
  • a block opened with three backticks and closed with four, which leaves the fence open, so the next headings become diagram text.

Check

New or generated Mermaid blocks with those constructs, and fences whose opening and closing lengths differ.

Test

A scan of the built site that runs mermaid.parse on every diagram block and reports each failure with its page.

CS-DOCS-007, CS-DOCS-004

CS-DP-DOCS-004: Over-indented admonition renders as a code block

Severity: minor · Applies to: docs · Enforced by: manual · Status: active

Symptom

A note renders as grey monospace text, with its bold, code and HTML markup shown literally.

Cause

An admonition body takes four spaces of indentation. With eight, the extra four make the body an indented code block. That is valid Markdown, so the strict build passes.

Check

Admonition bodies indented by more than four spaces, outside a code block the note means to show.

Test

Search the built HTML for an admonition title followed directly by a code block.

CS-DOCS-006

Build verification

CS-DP-DOCS-005: Quiet flag hides a failed strict build

Severity: minor · Applies to: docs, pipelines · Enforced by: manual · Status: active

Symptom

A local check records a clean build for a page with a broken link, and the pipeline later fails on the same page.

Cause

With -q, the strict build hides the warnings and does not return a failing exit code when strict mode aborts.

Check

Scripts, pipeline steps and verification notes that combine --strict with -q.

Test

Run the strict build without -q, and check both the exit code and that the output has no WARNING line.

CS-DOCS-004