Skip to content

Port home pages, port links, and reference navigation - #11

Merged
tony merged 15 commits into
mainfrom
port-home
Sep 12, 2026
Merged

tony merged 15 commits into
mainfrom
port-home

Conversation

@tony

@tony tony commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Eight changes to how a reader moves around a port's documentation and its API
reference. Each lands as its own commit.

  1. /<port>/<version>/ gets the documentation sidebar it was missing.
  2. Every port links its repository and its package-manager listings.
  3. The port home page installs through a per-manager picker, not one line.
  4. A port's MCP page carries an install widget for its own server.
  5. Reference pages keep the site's own navigation in the left column.
  6. The reference's By-module index is navigable.
  7. API examples appear only where the page's own language has one.
  8. API examples render through Expressive Code, like every other block.

tony added 15 commits September 12, 2026 09:23
A symbol with no example of its own still rendered an "Examples" section,
because the groups were built from every counterpart port that carried one
and the section rendered whenever two or more existed. On
/reference/ts/server-server/ that produced a TypeScript page whose Examples
block opened on Python doctest output with a Rust tab beside it.

Gate the groups on the page's own language having an example. A reader on a
TypeScript page asked for TypeScript; another language under that heading
reads as this page's example rather than as a substitute for a missing one.

Suppressing the entry's inline copy when the tabs render is the same fix
seen from the other side: with the gate in place, every tabbed section now
begins with the page's own language, which ApiEntry was already rendering
above it.
Examples in doc comments went through lib/highlight.ts — a Shiki call
wrapped in a hand-rolled card, at 0.8125rem in a different mono face, with a
copy button that only appeared on hover — while every other code block on the
site renders through astro-expressive-code. Two code systems on one page, and
the tabbed cross-language block had no copy button at all.

Both example renderers now use <Code>, so typeface, size, line height,
frame, theming and the copy button come from ec.config.mjs like everywhere
else. Expressive Code loads grammars lazily from the full Shiki bundle, so
java, swift and csharp examples are highlighted rather than flattened to
text as the eagerly-loaded LANGS list did.

codeLang() guards the swap: <Code> throws on an unknown grammar, and one bad
lang in one docstring would fail a build that renders 1,193 of them.

highlight() stays for highlightInline(), which the install widgets need
because they assemble their own container.
Every page under /ts/latest/ carries the sidebar; the root of that tree did
not. Landing on it from the version switcher or the port dropdown read as
leaving the documentation rather than arriving at it, and there was no way
into Topics, Guides or the workspace pages without going back.

DocsLayout gains a `bare` mode for it. The page is a hero and a card grid
rather than prose, so the reading column's styles would render the cards as
a document, and it carries its own <h1> under PortHero, so the layout's
would be a second one. Everything else the shell provides — the sidebar,
the mobile drawer, the three-column frame — is what this page was missing.
The index sections group by bucket, not by module, so a module name in the
By-module list had nothing to click through to. It was a name and a count —
`libtmux.types 65` — beside twenty others, and a reader who wanted to know
what was in a module had to scan every bucket for symbols whose id happened
to start with it.

Each module is a disclosure over its own symbols now. The id stays on the
element the count sits beside, because `#<module>` is where 9,160 links from
prose, signatures and the inventories land, and the script reveals it: a
browser opens a <details> that contains the fragment target but not one that
is the target.
The reference had no way out of itself. /reference/ts/ listed a thousand
TypeScript symbols and not one link back to the TypeScript guides, the
workspace pages or the MCP pages — the sidebar every other page carries was
replaced wholesale by the symbol tree.

Sidebar gains a `menuOnly` mode: the port's products, its documentation
areas and its references, without the page list. The full nav would push a
tree of twelve thousand symbols two screens down, and it also queries and
sorts the content collection, which the reference would pay for on every one
of its pages.

portAreas() builds the four shared areas from portPageUrl rather than
spelling out paths, so the version axis and the port root stay ports.ts's
business.
The text above a tabbed example rendered as raw doc-comment source, backticks
and all, while the same prose everywhere else on the page went through ApiDoc
and linked. Moving a symbol's own examples into the tabs made that visible as
a measurement: check-xrefs caught Python losing 12 resolved references.

Each panel now carries the index its intros resolve against. A counterpart's
prose is written in that port's dialect and names that port's symbols, so
resolving a Rust panel against the Python index would link the wrong page or,
more often, nothing — which is why this is a per-group index rather than the
page's own.

TypeScript gains 12 resolved references and Rust 10: counterpart intros never
resolved at all before.
A port page named its package and offered no way to reach it. The repository
was reachable only through the site footer, which points at the libtmux
organisation rather than at this language's own repository, and the registry
was not linked anywhere at all — a reader who wanted a changelog, a version
or an issue tracker had to guess the URL.

The marks are drawn in currentColor and take their brand colour on hover and
focus, so a row of them reads as text in either scheme and still picks out
under the pointer. Three of the seven are near-black published hexes, so each
mark carries a dark-scheme value too; GitHub, crates.io and Maven Central
would otherwise vanish into a dark page at the moment they are meant to
stand out.

C++ and Swift get the repository alone, which is honest: C++ resolves from
this project's own vcpkg git registry rather than the curated one, and Swift
resolves from the git URL, so for both the repository link already is the
distribution link.
One install string per port chose a tool for every reader of that language,
and for two ports it chose one that does not work. npm publishes `libtmux`,
not `@libtmux/libtmux` — the registry answers 404 for the scoped name this
site printed — and C++ is served from this project's own vcpkg git registry
rather than the curated one, so `vcpkg install libtmux-cxx` matched nothing.
Both were copy-and-run instructions that failed.

Each port now carries the list its readers actually use: pip/uv/pipx,
npm/pnpm/yarn/bun/deno, Gradle and Maven, CMake and vcpkg and a submodule.
Three of the eight cannot be installed from a command line at all, so their
panels are build-file fragments, which is why highlight.ts gains the kotlin,
xml, swift, cmake and toml grammars — those snippets rendered as flat grey.

Versions appear only where the tool cannot find a prerelease without one.
pip, cargo, go get and npm all resolve the current release on their own;
Gradle, Maven, SwiftPM and CMake each need the release named, so those four
carry one and say where it came from.

The picker gains a second strip inside each panel, rendered only where there
is a choice to make: Rust and Go still show their one command with nothing
above it. The choice is remembered per port, because picking pnpm says
nothing about picking uv.
The extracted model recorded the core package as `@libtmux/libtmux`, which
it took from ports.ts before that entry was corrected. Nothing renders the
core source's package name — the product pages read the workspace and mcp
entries — so this is the same fix in the one remaining place rather than a
visible one.

Trailing whitespace in two comments this branch added, while here.
/mcp/ has carried the client-by-scope install picker since it was ported
from the libtmux-mcp docs, but that page installs the Python server. A reader
who followed the TypeScript nav to /ts/latest/mcp/ got eight paragraphs about
a server and no way to point a client at it — and the same for the other six.

The picker is one widget with a per-port spec rather than a second widget,
because the axes that make it useful are port-independent: `claude mcp add
tmux -- <thing>` does not care what <thing> is, and neither do the fourteen
config scopes across eight clients. What differs is the command inside and
how you get it, which is what ServerSpec holds.

Every command comes from that port's own MCP README. Java, C++ and Swift
publish no binary, so their panels are the build step as a prerequisite and a
path placeholder — better than inventing a one-liner that would fail. C++'s
placeholder is not ~/.local/bin/…: a shell expands a tilde and a JSON config
does not.

Two axes had to become per-port to avoid a widget with no panel at all. The
cooldown axis is uv's alone — nothing in npm, cargo or go has
--exclude-newer — so other ports render no cooldown control and their panel
selectors ignore the cooldown attributes rather than pinning them to "off".
The method storage key is now per port: a reader who saved `uvx` on /mcp/
arrived at the TypeScript page with <html data-mcp-install-method="uvx">,
matching no selector, after the rule that hides the server-rendered default
had already fired.

Python's 126 panels are byte-for-byte what they were. configArgs is why: a
shell line says `uvx --no-config` and a config file says UV_NO_CONFIG=1, and
those are the same instruction told to two different readers.
A port page renders the picker restricted to its own port, which left a tab
strip holding a single tab that could not be switched away from — a control
that answers nothing, sitting above the control that answers something.
Both strips promised tab semantics they did not keep. Unselected tabs carry
tabindex="-1", so the only way to reach one was the Left and Right keys a
role="tablist" implies — and nothing listened for them. A keyboard reader
could see eight languages and select exactly one.

The command blocks under the manager strip are its tab panels and now say so.
The strip was added without them, which left a tablist pointing at nothing.
The fragment handler called scrollIntoView() on every load. Every reference
page but the module index lands on an ordinary heading the browser has
already scrolled to, so that was a second scroll fighting a restored
position for no reason.
Everything that can go wrong with these widgets goes wrong after first
paint. Both render every panel server-side and then re-select one from
localStorage, so the failures are a saved choice naming something this page
does not have, a prehydrate rule that matches no panel at all, and a tab
strip whose tabs cannot be reached from the keyboard. Class greps and
screenshots see none of that.

Twelve cases against the built pages, in the DOM harness code-tabs.test.ts
already established. The two that matter most are the ones that were real
bugs while this branch was being written: a TypeScript MCP page opened with
Python's saved method must still show a panel, and Python's own page must
still offer uvx and its cooldown control.
Swift resolves from the git URL, so the repository link is where the package
comes from — but it is not where a Swift reader looks to see the package's
platforms, its version history or whether the last release built. That is the
Swift Package Index, and this package is in its PackageList with a .spi.yml
in the repository.

C++ still gets the repository alone, which stays correct: it is served from
this project's own vcpkg git registry, so the repository URL already is the
registry URL, and the install picker's vcpkg panel is where that gets
explained because it takes a vcpkg-configuration.json to say.

.gitignore listed _site/ twice and covered no staging tree. A build into
_site.next is the way to assemble without churning the tree someone is
reading, and every file in one was addable.
@tony
tony merged commit 7d4df0d into main Sep 12, 2026
8 checks passed
@tony
tony temporarily deployed to docs-preview-cleanup September 12, 2026 17:28 — with GitHub Actions Inactive
@tony
tony deleted the port-home branch September 12, 2026 17:29
tony added a commit that referenced this pull request Nov 14, 2026
why: libtmux-raku #11 wrote tmux format names as code in the generated field
accessor docs, which the site links to its format catalog. The format catalog
coverage check was 0.807 against its 0.9 floor with the old docs; the model
needs the merged revision to carry the code spans.

what:
- Export the native API at libtmux-raku master 8293da87dc45, the merge of
  #11, from a master-pinned checkout, and regenerate the model, its path
  sidecar, the manifest inventory, the staged guide cache and the tmux usage
  record there; the usage evidence lines are unchanged
- Leave the landing example, its recording and the home fixture at 9a9838047f15:
  the program bytes are the same
- Format coverage is now 0.937 (1012 catalog and 104 other links, 75 plain of
  1191 mentions)

Source refs: libtmux/libtmux-raku master
8293da87dc45f61ea2a68d1cc5327b4e62892732, previous pin
9a9838047f1585c2c790b011cb708670999b7bdd.

This branch was previously deployed

2 inactive deployments
docs-preview-cleanup — 45185074 Deployed Sep 12, 2026 by tony via cleanup #7
docs-preview — 45185074 Deployed Sep 12, 2026 by tony via publish-preview / publish #105
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.

1 participant