Repository navigation
Conversation
Replace `plain: bool` threaded through four functions with a
`PageMode { Web, Plain }` enum whose methods encapsulate every
mode-dependent branch: color choice, raw-help transforms, body
processing, subdoc trailing, experimental badge, header, footer.
Collapses ~10 `if plain { ... } else { ... }` branches into single
method calls. Also extracts `BADGE_EXPERIMENTAL_HTML` constant so
the empty-span literal isn't duplicated between `experimental_marker`
and `post_process_for_html`.
Output is byte-identical —
test_command_pages_and_skill_files_are_in_sync passes unchanged, as
do the 40 help snapshot tests.
Co-Authored-By: Claude <[email protected]>
Switch the lychee-system hook's file filter from `types: [markdown]` to `files: '\.(md|txt)$'` so docs/static/llms.txt URLs get verified alongside the .md docs. identify has no `.txt` tag, so a files-regex is the clearest way to widen the set. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
Apr 24, 2026
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.
Summary
Two independent follow-ups from #2404 (llms.txt PR), surfaced during that session:
1.
refactor(help): unify --help-page plain/web paths behind PageModeReplaces
plain: boolthreaded through four functions (handle_help_page,format_subcommand_section,expand_subdoc_placeholders, and the caller inmaybe_handle_help_with_pager) with aPageMode { Web, Plain }enum. The enum's methods encapsulate each mode-dependent branch — color choice, raw-help transforms, body/subdoc-trailing processing, the experimental badge, and the page header/footer. Result: ~10if plain { ... } else { ... }branches become single method calls; the bool→enum switch also catchesSelf::_exhaustiveness if new modes are added. ExtractsBADGE_EXPERIMENTAL_HTMLas a constant to dedupe the empty-span literal betweenexperimental_markerandpost_process_for_html.2.
chore(ci): link-check .txt files with lycheeSwitches the
lychee-systempre-commit hook fromtypes: [markdown]tofiles: '\.(md|txt)$'sodocs/static/llms.txtURLs get verified alongside.mddocs.identifyhas no.txttag, so a files-regex is the clearest way to widen the set.Test plan
test_command_pages_and_skill_files_are_in_sync— passes unchanged (byte-identical--help-pageoutput for both modes)test_help— all 40 snapshot tests passcargo test --lib --bins— 606 unit tests passcargo clippy --all-targets --all-features -- -D warnings— cleanpre-commit run --all-files— all hooks pass, including lychee-system on the expanded file set (llms.txt URLs already check out)🤖 Generated with Claude Code