Skip to content

Close up the heading-level gaps on 82 pages - #148

Closed
oblomov-dev wants to merge 1 commit into
mainfrom
claude/heading-levels
Closed

Close up the heading-level gaps on 82 pages#148
oblomov-dev wants to merge 1 commit into
mainfrom
claude/heading-levels

Conversation

@oblomov-dev

Copy link
Copy Markdown
Member

82 of 123 pages jumped a level. 31 went straight from # to ####; 21 had ## and #### with no ### between them. Every page sets outline: [2, 4], so the box on the right collects h2 to h4 — on a page whose sections are h4 it showed them at the indent of a sub-sub-section, and on the 15 pages whose only heading level was h3, one level in.

One rule fixes all of them: map the levels a page actually uses onto consecutive levels starting at ##, preserving relative depth.

before after
# + #### # + ##
# + ## + #### # + ## + ###

The author's hierarchy survives exactly; only the gaps go. Zero pages have one left.

The anchors do not move — verified in the built HTML rather than assumed: VitePress emits <h4 id="play-sounds">, the id being the slugified text, not the level. All 111 fragment links in this repository still resolve.

Why now, when this was turned down before

For a good reason: ## used to be 24px with a rule and 72px of air, so promoting a section heading made pages shout. The compact layout since then puts h2 at 19px with a third of the padding — which is what makes this worth doing at all.

It broke check:version, and that is the point

The release headings in changelog.md were ### and became ##; the gate's pattern pinned ###, so a check about the release number went red over a #. It said so plainly — "the file changed shape, fix the pattern" — rather than silently matching nothing, which is the failure mode it was written against. The pattern now accepts any heading level, because the level was never what it was checking, and a gate that fires on a change it does not care about is one people learn to route around.


Generated by Claude Code

82 of 123 pages jumped a level - 31 went straight from `#` to `####`, 21
had `##` and `####` with no `###` between them. Every page sets
`outline: [2, 4]`, so the box on the right collects h2 to h4: on a page
whose sections are h4, it showed them at the indent of a sub-sub-section,
and on the 15 pages whose only heading level was h3, one level in.

One rule fixes all of them: map the levels a page actually uses onto
consecutive levels starting at `##`, preserving relative depth. `#`+`####`
becomes `#`+`##`; `#`+`##`+`####` becomes `#`+`##`+`###`. The author's
hierarchy survives exactly; only the gaps go. Zero pages have one left.

The anchors do not move - verified in the built HTML rather than assumed:
vitepress emits `<h4 id="play-sounds">`, the id being the slugified TEXT.
So all 111 fragment links in this repository still resolve.

This was proposed once and turned down, for a good reason: `##` was 24px
with a rule and 72px of air, so promoting a section heading made pages
shout. The compact layout since then puts `h2` at 19px with a third of the
padding, which is what made this worth doing at all.

It also broke `check:version`, and the way it broke is the point. The
release headings in changelog.md were `###` and became `##`; the gate's
pattern pinned `###`, so a check about the release NUMBER went red over a
`#`. It said so plainly - "the file changed shape, fix the pattern" -
rather than silently matching nothing, which is the failure it was written
against. The pattern now accepts any heading level, because the level was
never what it was checking, and a gate that fires on a change it does not
care about is one people learn to route around.
Copilot AI lite review requested due to automatic review settings August 16, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants