Patch Changes
-
#191
11ebb39Thanks @MohamedH1998! - Theapi-code-railcomponent keys its sample picker by sampleid, so several samples in one language each get their own option. It remembers the reader's language, not the exact sample: a saved language opens that language's first sample, and the choice syncs across open tabs.?lang=accepts a sample id or a language. With packages before 0.16.0, which give samples noid, the picker keys by language as before.api-code-railis distributed through the registry, not the scaffolded template. Existing sites update it withnimbus-docs add api-code-rail, choosing Overwrite forApiCodeRail.astroandcode-rail.client.ts. -
#189
5c96da8Thanks @MohamedH1998! - Refinements to the starter's API reference components:- Status and method colours are retuned. Method chips use a tint and a 25% line from the same palette (
--nb-m-*-tint,--nb-m-*-line). - Field rows fold like code. A collapsed row ends in
{ 4 properties }; an open row shows{on its signature and}under its children, centred on the guide line. "required" sits before the brace and never wraps away from it. - Union fields drop the variant list from their type text, since the list below names each variant. The full names show as a tooltip on the field name.
- Constraints and default share one line. Field rows no longer show examples, because the code rail's request and response examples already include them. Long values wrap instead of widening the page.
- The code rail's response toggle is a compact segmented control, and the header and response rows share 8px insets.
LayerCardtakesorientation="horizontal", whichApiEndpointCarduses.Badgegains anoutlinevariant.- Medium weight replaces semibold, letter-spacing is removed, and hover states no longer animate colour.
- Status and method colours are retuned. Method chips use a tint and a 25% line from the same palette (
-
#181
71ff242Thanks @MohamedH1998! - Addsidebartoapientries, so large API references stop putting the whole navigation tree in every page."full"(the default) keeps today's behavior."on-demand"includes top-level items plus the current page's branch. A collapsed group opens in place and loads its rows from its own page, where the sidebar lists them open; a group without a page, such as anx-tagGroupscategory, loads them from the API overview. Without JavaScript, a collapsed group's label still links to its page. The mode is read from theapientry in the Nimbus config, including for sites that pass their entry toapiCollection({ … }).api: [{ collection: "api", spec: "./src/api/openapi.yaml", sidebar: "on-demand" }],
ApiNavItemgains optionaldeferredandchildrenHreffields.@cloudflare/nimbus-docs/clientaddsinitNavSidebar(), and@cloudflare/nimbus-docs/runtimeaddsnavStateScript, an inline script, andnavBuildId, which a sidebar renders asdata-nb-nav-build. Together they keep a sidebar's open groups, loaded rows, and scroll position from page to page for the session, restored before the page paints and without replaying animations. Cached rows are tied to the build that rendered the page, so rows cached before a deployment are never shown after it, including on client-side navigation.apiCollection({ … })warns when it sets asidebarthe config doesn't match.A tag's
x-displayNamenow sets its label in the sidebar, page title, and breadcrumbs, while itsnamestill decides its coordinate and route. This lets a spec group hundreds of flat tags under readable parents.Group pages now list their subsections (
ApiSectionPage.sections), in HTML and Markdown, so every page stays reachable without the sidebar. The API overview no longer links anx-tagGroupscategory to itself: it lists the category's member sections instead. Both changes apply in every sidebar mode.Starter components:
ApiSidebarItemrenders a deferred group as a closed group with an empty panel, andApiLayoutmountsinitNavSidebarand the restore script for both the desktop rail and the mobile drawer. The API sidebar now keeps the groups a reader opened and its scroll position from page to page in every mode, and no longer fades or replays group animations during navigation. The mobile drawer moved ahead of the desktop rail inApiLayout, so one inline script restores both before the page paints.ApiBodylists a group page's subsections.Existing sites keep working unchanged with the default
sidebar: "full"."on-demand"needs the new API components: with older ones, the build fails and names the outdated files. Update them withnimbus-docs add api-layout, choosing Overwrite forapi-layoutandapi-sidebar.nimbus-docs addnow warns when the registry serves components from a different release than the project's@cloudflare/nimbus-docs. -
#182
9d2051cThanks @MohamedH1998! - - Cloudflare server scaffolds depend on@astrojs/cloudflare@~14.3.0, matchingcheck. -
Updated dependencies [
11e6d85,18b0005,9f54406,71ff242,a14c58f,278a3ff,e5fe9f3,aff3e9f,9d2051c]:- @cloudflare/nimbus-docs@0.16.0