All rules

Duplicate sibling heading

duplicate-headingon by defaultJapanese / English

Two headings with the same words under the same parent heading

Example

Flagged
# Setup guide ## Before you start Gather the tools. ## Before you start Wear gloves.
What chaff prints
7:1 The heading "Before you start" repeats the one on line 3 under the same parent
Fixed
# Setup guide ## Before you start Gather the tools. ## Safety Wear gloves.
What chaff prints
no finding

How to fix

Merge the two sections, or give each a heading that says how they differ.

Why it matters

Two headings with the same words under the same parent cannot be told apart in a table of contents, and an in-page link reaches only one of them. It happens when a section is copied and its heading is not changed, or when the same topic is written in two places. Under different parents the same words are fine (a changelog's "Added" and "Fixed" under each version, a "Summary" in each chapter). Case, full-width and half-width forms, and the number of spaces are ignored when comparing.

What it does not flag

Headings under different parents (each version's "Added" and "Fixed", each chapter's "Summary") are not compared. A fixed set of labels repeated in the same order for each case (Question and Answer, 【相談事例】 and 【回答】) is not reported either; a qualifier in brackets (Case (terms)) is set aside when the set is read. It runs on Markdown only.

Turning it off or relaxing it

Silence this one spot (in the document)
<!-- stet: duplicate-heading — reason -->
Relax it for the team (the reason is kept as a comment in chaff.yaml)
npx chaffjs relax duplicate-heading --why "reason"
Turn it off for the team (chaff.yaml)
rules: duplicate-heading: off
Technical details
Layer
L1
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).

stricterror
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

The heading "{heading}" repeats the one on line {firstLine} under the same parent

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