Repository navigation
Scope docs heading anchors under each subcommand section - #4079
Merged
Merged
Conversation
Command pages append every subcommand's help, so headings like "Examples" and "Command reference" repeat, and the site numbered their anchors (#examples-3) by position, shifting them whenever a section was added. The heading-id plugin now prefixes ids below a `wt …` H2 with that section's id (#wt-step-push--examples), so the CLI help keeps unqualified headings. The six `wt config` "<Noun> examples" renames that worked around the numbering go back to "Examples". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUmx2Jd5mTK5TznqGDmLGp
worktrunk-bot
approved these changes
Sep 12, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Command pages on the site append every subcommand's help, so headings such as "Examples", "Options", and "Command reference" repeat down
/step/and/config/. The heading-id plugin numbered the repeats by position (/step/#examples-3,/step/#hooks-1,/step/#command-reference-7), so an anchor pointed somewhere else once a same-named heading was added above it.docs/src/plugins/stable-heading-ids.mjsnow scopes ids below each subcommand's H2 (a heading startingwt) by that section's id: "Examples" underwt step pushis/step/#wt-step-push--examples. Page-level headings and the subcommand headings keep their ids, so the table of contents and links like/step/#wt-step-copy-ignoredare unchanged. A slug never contains--, so a scoped id can't equal another heading's slug — a "Cache" heading underwt config statestays distinct from thewt config state cachesection.With the site handling it, the CLI help keeps unqualified headings. #4000 renamed six
wt configsubcommand headings to "Approval examples", "Alias examples", and so on to avoid the numbering; they're back to "Examples", in--helpas well.Every anchor inside a subcommand section changes once:
/step/#min-age-guardis now/step/#wt-step-prune--min-age-guard. The two internal links that pointed at such anchors — the FAQ's copy-on-write link andwt config approvals' "Reading approval state" — are updated, andtest:sitechecks every internal fragment. External links to the old anchors land at the top of the page.The search-index plugin (
pagefind-command-references.mjs) now imports the subcommand-heading check from the heading-id plugin rather than keeping its own copy.🤖 Generated with Claude Code
https://claude.ai/code/session_01HUmx2Jd5mTK5TznqGDmLGp