Sub topic 3
Building a heading hierarchy
This chapter assumes you have written work documents such as reports or documentation, and that you can read simple Markdown, where # marks a heading. It covers how to plan heading levels so the outline of a document matches its content.
What a heading hierarchy is
A heading hierarchy is the set of heading levels in a document, arranged so that each level sits inside the one above it. Level 1 is the document title. Level 2 headings are the main parts. Level 3 headings are the subparts of a level 2 section.
Skimming readers use the hierarchy as a map. They read the level 2 headings to find the right part, then the level 3 headings to find the right spot. If the levels are inconsistent, the map is wrong.
Rules for the levels
- Use one level 1 heading. It names the whole document. Several level 1 headings make it unclear what the document is about.
- Nest by containment. A level 3 heading belongs under a level 2 heading only if its content is a part of that section.
- Never skip a level. Do not jump from level 2 to level 4. Skipped levels leave a gap in the outline, and screen readers and navigation tools report the gap.
- Keep siblings equal in weight. Headings at the same level should cover topics of similar size and kind.
- Stop at level 3 where you can. A fourth level usually means a section is too large. Split it, or turn the detail into a list.
- Avoid a lone subheading. A section with only one level 3 heading under it has no real division. Merge the two headings, or add the missing sibling.
Building the outline first
Draft the headings before the prose. Write the level 2 headings, check that together they cover the document, and then add level 3 headings where a section needs them. This is the same plan-first habit as in the previous chapter on choosing a structure: the outline is the plan.
# Backup System Guide
## Understanding the nightly backup
### What the backup copies
### Where the copies are stored
## Fixing a failed backup
### Checking the log
### Rerunning the job
## Restoring filesEach level 2 heading covers one task or topic. Each level 3 heading is a part of its parent. Read only the headings, and you can already tell what the guide contains.
The same outline as a tree:
Common errors
| Error | Result | Fix |
|---|---|---|
| Choosing a level for its size or style | The outline no longer reflects the content | Choose levels by nesting, and change the appearance with styles |
| Skipping from level 2 to level 4 | A gap in the outline | Add the missing level 3 or promote the heading |
| Several level 1 headings | No clear document title | Keep one, and demote the rest to level 2 |
| Level 3 headings of mixed size | Readers cannot judge what each covers | Move large topics up, merge small ones |
Checking the hierarchy
Extract only the headings and read them in order. If the list reads as a sensible table of contents, the hierarchy works. If a heading seems out of place, it probably sits at the wrong level or in the wrong section.
Exercise
A document has this outline: "# Setup Guide", "## Install the tool", "#### Set the path variable", "## Configure access". Name two problems and give a corrected outline.
Show answer
First, the level 4 heading skips level 3, which leaves a gap under "Install the tool". Second, it is the only subheading in its section, so it divides nothing. Corrected outline: "# Setup Guide", "## Install the tool" (with the path variable step written as part of its content), "## Configure access". If more steps are added, give them level 3 headings under "Install the tool".