Repository navigation
Conversation
…s, formats
why: A tmux command such as `list-clients` rendered as a plain link,
with no kind badge or hover card, while the API names beside it carried
both. `session_attached` and `destroy-unattached`, which the tmux manual
documents, were not linked at all.
what:
- Read options, hooks and format variables from the pinned manual per
release, anchored on the same headings the full manual page renders
- Resolve every command, option, hook and format-variable link through
tmuxEntityHref, so the destination of every kind changes in one place
- Link option and hook names written in code, and format variables that
are a whole code span or sit inside a #{...} expression; names the
release does not document, URI templates and calls stay plain
- Keep library symbols ahead of options, hooks and format variables in
HTML, prose Markdown and symbol Markdown, so `pane_id` still reaches a
Rust field where the page documents one
- Render each lone mention with the API kind badge (command $, option o,
hook h, format #) and add the four kinds to the badge palette in the
light, system dark and explicit dark themes; several names in one code
run stay links without badges, and Markdown keeps plain links
- Serve preview cards for command pages and for each manual entry by
anchor, with an "Open manual" action, and make manual links eligible
for hover previews outside the command index and heading permalinks
- Load the highlighter only when the manual is highlighted, so link
resolution no longer imports it
- Test the three mention kinds, the hover-card data and unknown names,
and accept manual entry anchors in the native prose destination check
Contributor
Author
|
Folded into #157, which now carries every fix from the 2026-10-18 review on one branch so they share one CI run, preview and deploy. This commit is on that branch unchanged. Discussion and evidence stay here. |
This branch was successfully deployed
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.
tmux commands, options, hooks and format variables now render like API mentions: a kind badge, the name, a hover card from the pinned tmux manual, and a link into that manual.
On the Rust page Server, session, window, pane,
list-clientswas a plain link beside[S] Client, andsession_attachedanddestroy-unattachedwere not linked at all, though the tmux manual documents both. This covers "Native tmux concepts" (P0 15) and "tmux command interlinking across ports" (P0 18).Before and after
Dark theme, and the hover card for
destroy-unattached:The screenshots live on
tmux-mention-badges-screenshots, a branch that holds only these four files; delete it after review. "Before" is the deployed site. "After" is a local dev server on the Rust port. A port-scoped build does not serve/tmux/pages, so the card's JSON came from the real preview endpoint code through a local static server, and the page's own preview script rendered it.What readers get
Four kinds, named so a tmux catalog can share them:
command$list-clients/tmux/latest/manual/list-clients/format#session_attached/tmux/latest/manual/full/#session_attachedoptionodestroy-unattached/tmux/latest/manual/full/#options-destroy-unattachedhookhsession-created/tmux/latest/manual/full/#hooks-session-createdapi-link-kind api-nav__kind api-badge--kind-*markup as an API mention, so badge spacing, underline and alignment changes apply to both. The four kinds join the badge palette in the light, system-dark and explicit-dark themes.Format variables, options and hooks come from the pinned manual for each release (3.2a and 3.7c), using the same anchors the full manual page renders. A name the release does not document is not linked.
Detection rules
Options, hooks and format variables link only inside code, where a name is deliberate:
remain-on-exit,pane-died).#{...}expression, quoted or not.mouse,pid,tmux://panes/{pane_id},capture_pane(pane_id),--destroy-unattached, and a name inside a path or flag.session_nameon the Rust page still reaches its Rust field, andsession_attachedgoes to tmux.tmux set-option -g destroy-unattached on, become separate links with no badges, so the run keeps its code flow.One resolver
tmuxEntityHref(kind, name, version)intmux-links.tsis now the only place a tmux name becomes a destination, including commands. It returns the manual anchor today and nothing for an unknown name. The catalog work can change its body to point at catalog routes.Coverage
Measured by rendering every Markdown page under
site/src/content/docsthrough the real pipeline (440 pages; MDX pages are not counted), and every API doc comment through the same linker the reference pages use.The 15 section links in the "before" total are authored links to manual sections. The 137 unbadged links after are those 15 and 122 mentions inside multi-name code runs.
Verification
pnpm run lint: no new warnings.pnpm run type-check: 0 errors.node scripts/check-api-links.mjsandnode scripts/check-nav.mjspass.site/test/tmux-mentions.test.ts(plus one card test inlink-preview.test.ts) cover a command, a format variable, an option and a hook, the hover-card data, the badge classes shared with API mentions, the palette in all three themes, Markdown agreement, API precedence, and unknown names with a linked control. All 43 fail onorigin/main.native-prose-ownership.test.tsandport-prose.test.tsnow allow a native tmux page to linksession_nameand similar names to the manual, and still reject library links.Not run: the timed
pnpm testloops (the host was too loaded to meet their budgets), the publication audit and its browser matrix, and the assembled-sitecheck-links.mjs --all. The new anchors are covered by a unit test that resolves every entity in the rendered manual.Notes
link-preview-paint.tsnow treats/tmux/<version>/manual/<command or full>/as preview targets, and skips the command index list and mandoc heading permalinks.tmux-manual.tsloads the highlighter only when it highlights the manual, so link resolution no longer imports it.linkTmuxManualTreeexposes the existing anchor pass for the entity data.prefixis also an option.