Repository navigation
docs(reference): repair broken in-page anchors for custom columns and default_branch object - #4688
Conversation
… default_branch object
worktrunk-bot
left a comment
There was a problem hiding this comment.
Every line this PR edits is in a generated region. The source is after_long_help in src/cli/mod.rs ([custom columns](#custom-columns) appears three times there, and [default_branch object](#default-branch-object) once), and test_docs_are_in_sync regenerates all five files from it. Running cargo test --test integration test_docs_are_in_sync on this head fails and reverts every change, so the PR can't land as-is (per docs/AGENTS.md: "Never edit generated regions or mirrors directly").
Moving the edit into src/cli/mod.rs won't work either. The site and the skill copies are generated from the same text but use different slug rules:
- Site:
slugHeadingindocs/src/plugins/stable-heading-ids.mjsreplaces every run of non-letter/number characters with-, so### default_branch objectgets the iddefault-branch-object. The original link was correct on worktrunk.dev, and the change todocs/src/content/docs/list.mdbreaks it (see inline). The site renderer also moves[experimental]off the heading into a badge, so#custom-columnsresolves there too. - Skill copies (GitHub slugger): these keep
_and the[experimental]suffix, so the two links you found really are dead there.
A single fragment can't satisfy both renderers. The fix belongs in the skill-mirror generation in tests/integration_tests/readme_sync.rs. One option is to move [experimental] off heading lines the way src/help.rs already does for the site, which fixes the custom-columns links. The default_branch link would still need a fragment rewrite, or a heading without the underscore. Which of these to do is a maintainer call. The dead anchors are a real catch.
|
Thanks for the fast and precise review — accepting the analysis fully. To summarize what I understand and propose: What I got wrong: I hand-edited generated regions (against What is still true: in the skill-mirror copies (GitHub slugger), Proposal, pending your call: move the fix into the skill-mirror generation in
Happy to implement whichever you prefer (option 1 is the smaller diff and keeps the JSON key literal in the heading). I have left the branch as-is for reference; feel free to close this PR if you would rather land the generator fix yourself — I can also reopen as a fresh PR against |
|
Your summary matches what I found. One correction to option 2: renaming the heading to There's a third option that avoids special-casing either link. I'd lean toward that general rewrite, or toward option 1 if it should stay minimal. Choosing between them is the maintainer's call, so I'll leave that to them. Either way, the change belongs in the generator, and |
|
Let's fix the class in the generator: have
|
|
@worktrunk-bot want to make those changes? |
…lugs Help text links headings by their worktrunk.dev id, which drops the [experimental] badge and turns _ into -. The skill mirrors render with GitHub's slugger, so #custom-columns and #default-branch-object were dead there. finalize_skill_content now maps each heading's site slug to its GitHub slug and rewrites in-page links that differ, replacing the hand edits to generated regions. Co-authored-by: viwe-monai <viwe-monai@users.noreply.github.com>
|
Done in 504f839 (pushed to this branch).
|
What
Nine in-page anchor links in the reference docs point at fragments that no heading generates:
](#custom-columns)- the heading is### Custom columns [experimental](skills/worktrunk/reference/list.md:123,#### Custom columns [experimental]atskills/worktrunk/reference/config.md:231), so the generated fragment is#custom-columns-experimental. 6 links updated (list.md x2, config.md x1, plus theplugins/worktrunk/synced copies).](#default-branch-object)- the heading is### default_branch object(skills/worktrunk/reference/list.md:331,docs/src/content/docs/list.md:347), so the fragment is#default_branch-object(underscore, not hyphen). 3 links updated (skills + plugins list.md, docs list.md).The
docs/src/content/docs/list.mdcopy of the custom-columns links was left alone: its own heading is### Custom columns(no[experimental]suffix), so#custom-columnsresolves there.Why
Readers of the Columns table and the JSON object docs click these links and land nowhere. The default_branch link is especially easy to miss since
head-object/worktree-objectnext to it do resolve.How it was verified
mainfiles; fragment names follow the GitHub slugger ([]stripped, spaces to hyphens,_kept).{{ env.LINK }}and literal.../@/...ellipses, which are intentional and untouched).skills/worktrunk/reference/andplugins/worktrunk/skills/worktrunk/reference/copies were kept byte-identical.Follow-ups deliberately left out
[experimental]suffix in the headings leaks into the fragments; renaming headings would produce cleaner anchors but changes existing inbound links elsewhere, so only the links were repaired.