All rules

A table-of-contents entry with no heading

toc-heading-mismatchon by defaultJapanese / English

A table of contents entry that matches no heading of the document

Example

Flagged
## Contents - 1 Overview - 2 Costs - 3 Schedule ## 1 Overview An overview. ## 2 Fees The fees. ## 3 Schedule The schedule.
What chaff prints
4:3 No heading matches the contents entry "2 Costs"
Fixed
## Contents - 1 Overview - 2 Fees - 3 Schedule ## 1 Overview An overview. ## 2 Fees The fees. ## 3 Schedule The schedule.
What chaff prints
no finding

How to fix

Update the entry to match the heading, or remove the entry for a section that is gone.

Why it matters

When the table of contents lists "3.2 Costs" and the text has no such heading, the reader cannot get there from the contents. It happens when a heading is renamed or a section removed and the contents are left as they were. Matching the entries against the headings is mechanical.

What it does not flag

Entries and headings are compared ignoring spaces, punctuation and case, and again without a leading number (1.2, 2-1) or a page number (.... 12). For a linked entry the link text is compared (broken-link checks where it points). When more than half of the entries match no heading, the contents are read as following another outline and nothing is reported. Only Markdown documents with headings are checked.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: toc-heading-mismatch — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax toc-heading-mismatch --why "reason"
Turn it off for the team (chaff.yaml)
rules: toc-heading-mismatch: off
Technical details
Layer
L3
Status
stable
Severity
warning
Languages
Japanese and English
Suited to
business, technical, blog, legal, docs, academic, literature, speech
Reads from the document
markdown

Levels

Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).

normalwarning
relaxedinfo

This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.

By genre

Runs by default in
technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, business/proposal, business/report, business/email, business/press-release, business/meeting-notes, legal/contract, legal/statute, legal/judgment, legal/patent, docs/manual, docs/faq, docs/glossary, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript

Genres

Message

No heading matches the contents entry "{entry}"

This page is built from the rule's definition file:packages/chaff/rules/toc-heading-mismatch.yaml