Skip to content

feat(docs): style experimental markers as badge pills - #1499

Merged
max-sixty merged 9 commits into
mainfrom
experimental
Mar 14, 2026
Merged

max-sixty merged 9 commits into
mainfrom
experimental

Conversation

@max-sixty

@max-sixty max-sixty commented Mar 14, 2026 •

Copy link
Copy Markdown
Owner

Replaces plain [experimental] text in web docs with styled pill badges — small uppercase labels with a subtle border that read as metadata rather than emphasis.

Canonicalizes all experimental markers to [experimental] (was a mix of [experimental], (experimental), (Experimental)). One marker format in cli.rs, one .replace() in the post-processing.

Also renames colorize_ci_status_for_html → post_process_for_html (it handles badges and URLs too), adds a module docstring documenting the full --help-page pipeline, and fixes a latent double-application of the post-processor on subdoc content.

This was written by Claude Code on behalf of @max-sixty

max-sixty and others added 3 commits March 13, 2026 20:10
Replace plain `[experimental]` and `(experimental)` text in web docs
with styled pill badges. Subdoc section headings get the badge inline
after the title; bullet lists and table cells get it inline.

The badge uses the theme's muted gray with a subtle border — reads as
metadata rather than emphasis. Terminal help output is unchanged.

Also fixes a latent bug where `colorize_ci_status_for_html` was applied
twice to subdoc content (once inside `format_subcommand_section`, again
in the caller). Previously harmless since existing replacements are
idempotent, but the new badge replacement exposed it.

Co-Authored-By: Claude <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice idea — pill badges are a much better visual treatment than plain [experimental] text. The CSS is clean, the shortcode is a good DRY mechanism, and the strip_experimental_prefix approach for subdoc headings is well-designed.

A few issues to address:

1. Broken anchor links (CI failure)

The check-docs job fails with 3 broken internal anchor links:

The anchor in the link `@/step.md#wt-step-for-each` does not exist.
The anchor in the link `@/step.md#wt-step-prune` does not exist.
The anchor in the link `@/step.md#wt-step-relocate` does not exist.

Adding the badge span to the ## headings changes the generated anchor IDs. The Operations list at the top of step.md links to #wt-step-for-each etc., but Zola now generates a different anchor that includes the badge text.

A possible fix: use a Zola heading ID override (e.g., {#wt-step-for-each}) or move the badge outside the heading element.

2. Skill reference files contain raw HTML

The skill files (consumed by LLMs, not rendered as HTML) now contain raw <span class="badge-experimental">experimental</span> — e.g., in skills/worktrunk/reference/step.md. transform_docs_for_skill handles the Zola {{ experimental() }} shortcode (converting it to (experimental)), but doesn't strip the HTML badge spans that come from auto-generated command pages.

Adding a regex replacement for <span class="badge-experimental">experimental</span> → (experimental) in transform_docs_for_skill would keep skill files clean.

3. Minor: double-application fix

The removal of the outer colorize_ci_status_for_html on subdoc content looks correct — format_subcommand_section already applies it to each subcommand's main_content. The comments explaining why are helpful.

Standardize on `[experimental]` everywhere in cli.rs — previously a mix of
`[experimental]`, `(experimental)`, and `(Experimental)`. Now one pattern,
one `.replace()` in the post-processing.

Also renames `colorize_ci_status_for_html` → `post_process_for_html`
(it handles badges and URLs too, not just CI dots), and adds a module
docstring documenting the full help-page generation pipeline.

Co-Authored-By: Claude <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The new commit adds solid infrastructure — the architecture docs, the post_process_for_html rename, and the Zola shortcode handling in transform_docs_for_skill are all good. Two issues from the previous review remain:

1. Broken anchors (check-docs CI still failing). The <span> in headings like ## wt step for-each <span ...> changes Zola's generated anchor ID, breaking #wt-step-for-each links. Fix: emit an explicit Zola heading ID override when a badge is present.

2. Skill files still contain raw HTML spans. transform_docs_for_skill now handles {{ experimental() }} shortcodes, but command-page docs go through post_process_for_html which converts [experimental] → <span class="badge-experimental">...</span> before the skill transform sees them. The HTML spans pass through unchanged into skill files (see skills/worktrunk/reference/step.md). Adding a regex replacement for the badge HTML → [experimental] in transform_docs_for_skill would close this gap.

Comment thread src/help.rs Resolved
Comment thread tests/integration_tests/readme_sync.rs Resolved
max-sixty and others added 2 commits March 13, 2026 21:02
Move experimental badge from heading to paragraph start in documentation.
Remove inline styling logic that positioned badges in headings, replacing
it with simpler inline placement at paragraph start. This simplifies both
the Rust help system and SCSS by eliminating special heading-context rules.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The anchor fix is clean — moving badges from headings to body text avoids Zola's anchor-ID issue without any workarounds. Removing strip_experimental_prefix simplifies the pipeline nicely.

One issue remains from the previous two reviews: skill files still contain raw HTML badge spans. transform_docs_for_skill now handles {{ experimental() }} shortcodes, but command-page docs go through post_process_for_html which converts [experimental] → <span class="badge-experimental">…</span> before the skill transform sees them. The HTML passes through unchanged — see the inline comment for a fix.

Comment thread tests/integration_tests/readme_sync.rs Resolved

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The incremental changes look good — the step.md anchor fix (moving badges from headings to body text), the latest snapshot updates, and the doc re-sync are all clean.

One issue remains from the previous reviews: skill files still contain raw HTML badge spans. transform_docs_for_skill now handles {{ experimental() }} shortcodes (for manually-written docs like faq.md), but command-page docs (step, list, config, llm-commits) go through post_process_for_html which converts [experimental] to <span> HTML before transform_docs_for_skill sees them. The HTML passes through unchanged — see the inline suggestion for a one-line fix.

Comment thread tests/integration_tests/readme_sync.rs Resolved
transform_docs_for_skill handled {{ experimental() }} shortcodes but not
the <span> badges injected by post_process_for_html on auto-generated
pages. Skill files now show plain [experimental] consistently.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 0760817 into main Mar 14, 2026
21 checks passed
@max-sixty
max-sixty deleted the experimental branch March 14, 2026 07:12
worktrunk-bot added a commit that referenced this pull request Mar 14, 2026
The review-pr skill said "Do not repeat any point from previous
reviews" but this wasn't specific enough — the bot posted 3 nearly
identical inline comments on the same file/line across 3 review
cycles of PR #1499 (readme_sync.rs:1586, all about the same
transform_docs_for_skill gap).

Strengthen the instruction: explicitly state that if an existing bot
comment targets the same file and makes the same point, the new
comment should be skipped — even if the issue persists. The existing
comment is still visible and unresolved.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
max-sixty added a commit that referenced this pull request Mar 14, 2026
\`colorize_ci_status_for_html\` was renamed to \`post_process_for_html\`
and moved from \`src/main.rs\` to \`src/help.rs\` in #1499. The docs
CLAUDE.md reference was stale.

> _This was written by Claude Code on behalf of @max-sixty_

Co-authored-by: Claude <[email protected]>
max-sixty pushed a commit that referenced this pull request Mar 14, 2026
## Summary

Strengthen the duplicate-comment prevention in the review-pr skill. The
bot was posting nearly identical inline comments across review cycles
(seen in run 23082553898 on PR #1499 — 3 comments on the same line
flagging the same issue).

The existing "do not repeat" instruction was too vague. Added explicit
guidance to cross-reference planned comments against existing bot
comments before posting.

## Test plan

- [ ] Verify next multi-cycle review doesn't re-post inline comments
that already exist

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: worktrunk-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
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.

2 participants