Skip to content

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

Merged
oblomov-dev merged 1 commit into
mainfrom
claude/heading-levels
Aug 16, 2026
Merged

Close up the heading-level gaps on 82 pages#147
oblomov-dev merged 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, 15 used only # and ###.

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; on the h3-only pages, 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 is the slugified text, not a function of the level. All 111 fragment links in this repository still resolve.

Why now

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 broke check:version, and that is the interesting part

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 failed honestly"the file changed shape — fix the pattern in scripts/check-version.mjs, or this gate silently stops checking that place" — rather than matching nothing and passing, which is the exact 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.

npm run check is green.


Generated by Claude Code

Copilot AI lite review requested due to automatic review settings August 16, 2026 15:40

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.

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.
@oblomov-dev
oblomov-dev force-pushed the claude/heading-levels branch from 5876ea6 to 172c0a1 Compare August 16, 2026 15:57
@oblomov-dev
oblomov-dev merged commit 6597796 into main Aug 16, 2026
1 check passed
@oblomov-dev
oblomov-dev deleted the claude/heading-levels branch August 16, 2026 16:01
@oblomov-dev
oblomov-dev restored the claude/heading-levels branch August 16, 2026 16:38
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