From 2101fa5a0773291d81ae2a97eb3f8bccd23b6e03 Mon Sep 17 00:00:00 2001 From: Minsu Lee <1964421+amondnet@users.noreply.github.com> Date: Sun, 22 Nov 2026 12:51:56 +0900 Subject: [PATCH 1/4] docs: migrate apps/docs from Nuxt/docs-please to Cloudflare Nimbus (Astro) - Replace the Nuxt + docs-please site with a Nimbus 0.20.0 (Astro 7) scaffold; port all 13 pages and the landing page (numeric prefixes dropped, sidebar.order kept, duplicate H1s removed, internal links rewritten). - Code groups become Tabs in installation.mdx and configuration/overview.mdx; the landing uses LinkButton and CardGrid. - URLs move from /docs// to ///; public/_redirects keeps old links working. - wrangler.jsonc stays Cloudflare Pages format (code-please-docs, output ./dist); the D1 binding is gone since the site is static. - eslint ignores apps/docs/** (scaffold code style) and drops the Nuxt MDC override. --- apps/docs/.gitignore | 42 +- apps/docs/AGENT.md | 159 ++ apps/docs/CLAUDE.md | 3 + apps/docs/app/app.config.ts | 12 - apps/docs/astro.config.ts | 51 + apps/docs/content/docs/.navigation.yml | 1 - .../docs/1.getting-started/.navigation.yml | 1 - .../content/docs/2.guides/.navigation.yml | 1 - .../docs/3.configuration/.navigation.yml | 1 - .../content/docs/4.reference/.navigation.yml | 1 - apps/docs/nimbus.json | 15 + apps/docs/nuxt.config.ts | 35 - apps/docs/package.json | 41 +- apps/docs/public/_headers | 4 + apps/docs/public/_redirects | 1 + apps/docs/public/favicon.ico | Bin 0 -> 2976 bytes apps/docs/public/favicon.svg | 1 + apps/docs/src/components.ts | 21 + apps/docs/src/components/AgentDirective.astro | 37 + apps/docs/src/components/ConnectMcp.astro | 28 + apps/docs/src/components/Header.astro | 147 ++ apps/docs/src/components/Logo.astro | 10 + apps/docs/src/components/Render.astro | 107 + apps/docs/src/components/WebMCP.astro | 24 + .../docs/src/components/connect-mcp.client.ts | 38 + apps/docs/src/components/logo.ts | 12 + apps/docs/src/components/ui/aside/Aside.astro | 96 + apps/docs/src/components/ui/aside/index.ts | 1 + apps/docs/src/components/ui/badge/Badge.astro | 42 + apps/docs/src/components/ui/badge/index.ts | 1 + .../src/components/ui/banner/Banner.astro | 102 + .../src/components/ui/banner/banner.client.ts | 56 + apps/docs/src/components/ui/banner/index.ts | 1 + .../ui/breadcrumbs/Breadcrumbs.astro | 93 + .../src/components/ui/breadcrumbs/index.ts | 1 + .../src/components/ui/button/Button.astro | 71 + apps/docs/src/components/ui/button/index.ts | 13 + .../docs/src/components/ui/button/variants.ts | 91 + .../components/ui/card-grid/CardGrid.astro | 16 + .../docs/src/components/ui/card-grid/index.ts | 1 + apps/docs/src/components/ui/card/Card.astro | 55 + apps/docs/src/components/ui/card/index.ts | 1 + apps/docs/src/components/ui/code/Code.astro | 36 + apps/docs/src/components/ui/code/index.ts | 1 + .../ui/collapsible/Collapsible.astro | 27 + .../ui/collapsible/CollapsibleContent.astro | 31 + .../ui/collapsible/CollapsibleTrigger.astro | 23 + .../ui/collapsible/collapsible.client.ts | 22 + .../src/components/ui/collapsible/index.ts | 3 + .../src/components/ui/dialog/Dialog.astro | 35 + .../components/ui/dialog/DialogClose.astro | 27 + .../components/ui/dialog/DialogContent.astro | 22 + .../ui/dialog/dialog-close.client.ts | 7 + .../src/components/ui/dialog/dialog.client.ts | 31 + apps/docs/src/components/ui/dialog/index.ts | 3 + .../components/ui/image-zoom/ImageZoom.astro | 103 + .../ui/image-zoom/image-zoom.client.ts | 118 ++ .../src/components/ui/image-zoom/index.ts | 1 + .../components/ui/layer-card/LayerCard.astro | 36 + .../ui/layer-card/LayerCardContent.astro | 22 + .../ui/layer-card/LayerCardHeader.astro | 22 + .../src/components/ui/layer-card/index.ts | 3 + .../ui/link-button/LinkButton.astro | 78 + .../src/components/ui/link-button/index.ts | 1 + .../ui/package-managers/PackageManagers.astro | 140 ++ .../components/ui/package-managers/index.ts | 1 + .../package-managers.client.ts | 59 + .../ui/page-actions/PageActions.astro | 86 + .../src/components/ui/page-actions/index.ts | 1 + .../ui/page-actions/page-actions.client.ts | 62 + .../components/ui/pagination/Pagination.astro | 117 + .../ui/pagination/PaginationKey.astro | 52 + .../ui/pagination/PaginationLink.astro | 81 + .../src/components/ui/pagination/index.ts | 3 + .../ui/pagination/pagination.client.ts | 106 + .../components/ui/search/SearchDialog.astro | 52 + .../components/ui/search/SearchTrigger.astro | 30 + apps/docs/src/components/ui/search/index.ts | 2 + .../ui/search/providers/pagefind.ts | 98 + .../ui/search/search-trigger.client.ts | 8 + .../src/components/ui/search/search.client.ts | 295 +++ .../ui/shortcuts/ShortcutsToggle.astro | 44 + .../docs/src/components/ui/shortcuts/index.ts | 1 + .../ui/shortcuts/shortcuts-toggle.client.ts | 22 + .../src/components/ui/sidebar/Sidebar.astro | 66 + .../components/ui/sidebar/SidebarFilter.astro | 38 + .../components/ui/sidebar/SidebarGroup.astro | 101 + .../ui/sidebar/SidebarGroupHeader.astro | 37 + .../components/ui/sidebar/SidebarLink.astro | 46 + apps/docs/src/components/ui/sidebar/index.ts | 5 + .../components/ui/sidebar/sidebar.client.ts | 255 +++ apps/docs/src/components/ui/steps/Step.astro | 26 + apps/docs/src/components/ui/steps/Steps.astro | 118 ++ apps/docs/src/components/ui/steps/index.ts | 2 + .../src/components/ui/steps/steps.client.ts | 30 + .../src/components/ui/switch/Switch.astro | 79 + apps/docs/src/components/ui/switch/index.ts | 1 + .../src/components/ui/switch/switch.client.ts | 11 + .../docs/src/components/ui/tabs/TabItem.astro | 31 + apps/docs/src/components/ui/tabs/Tabs.astro | 51 + .../src/components/ui/tabs/TabsContent.astro | 25 + .../src/components/ui/tabs/TabsList.astro | 57 + .../src/components/ui/tabs/TabsTrigger.astro | 32 + apps/docs/src/components/ui/tabs/index.ts | 5 + .../src/components/ui/tabs/tabs.client.ts | 142 ++ .../ui/theme-toggle/ThemeToggle.astro | 35 + .../src/components/ui/theme-toggle/index.ts | 1 + .../ui/theme-toggle/theme-toggle.client.ts | 39 + .../src/components/ui/toc/MobileTOC.astro | 61 + apps/docs/src/components/ui/toc/TOC.astro | 99 + apps/docs/src/components/ui/toc/index.ts | 2 + .../components/ui/toc/mobile-toc.client.ts | 136 ++ apps/docs/src/components/ui/toc/toc.client.ts | 360 ++++ apps/docs/src/content.config.ts | 18 + .../docs/configuration/formatter-config.md} | 6 +- .../content/docs/configuration/lsp-config.md} | 8 +- .../content/docs/configuration/overview.mdx} | 23 +- .../docs/getting-started/installation.mdx} | 46 +- .../docs/getting-started/introduction.md} | 8 +- .../docs/getting-started/quick-start.md} | 10 +- .../content/docs/guides/auto-formatting.md} | 8 +- .../content/docs/guides/claude-code-hooks.md} | 8 +- .../content/docs/guides/lsp-diagnostics.md} | 8 +- .../content/docs/guides/mcp-server.md} | 8 +- .../index.md => src/content/docs/index.mdx} | 69 +- .../content/docs/reference/api.md} | 4 +- .../content/docs/reference/cli-commands.md} | 4 +- .../docs/reference/supported-languages.md} | 4 +- apps/docs/src/layouts/BaseLayout.astro | 165 ++ apps/docs/src/layouts/DocsLayout.astro | 449 ++++ apps/docs/src/lib/cn.ts | 7 + apps/docs/src/lib/shortcuts.ts | 13 + apps/docs/src/lib/variants.ts | 44 + apps/docs/src/pages/404.astro | 35 + apps/docs/src/pages/[...section]/llms.txt.ts | 3 + apps/docs/src/pages/[...slug].astro | 71 + apps/docs/src/pages/[...slug]/index.md.ts | 3 + apps/docs/src/pages/[...slug]/index.mdx.ts | 3 + apps/docs/src/pages/llms-full.txt.ts | 3 + apps/docs/src/pages/llms.txt.ts | 3 + .../src/pages/nimbus-api/coordinates.json.ts | 19 + apps/docs/src/pages/og.png.ts | 12 + apps/docs/src/pages/og/[...slug].ts | 19 + apps/docs/src/pages/og/_card.ts | 82 + .../docs/src/pages/og/_fonts/Inter-Medium.ttf | Bin 0 -> 325304 bytes .../src/pages/og/_fonts/Inter-Regular.ttf | Bin 0 -> 324820 bytes apps/docs/src/pages/robots.txt.ts | 22 + apps/docs/src/styles/globals.css | 792 +++++++ apps/docs/src/styles/prose.css | 402 ++++ apps/docs/tsconfig.json | 9 +- apps/docs/wrangler.jsonc | 12 +- bun.lock | 1878 ++++------------- eslint.config.js | 10 +- 153 files changed, 7808 insertions(+), 1717 deletions(-) create mode 100644 apps/docs/AGENT.md create mode 100644 apps/docs/CLAUDE.md delete mode 100644 apps/docs/app/app.config.ts create mode 100644 apps/docs/astro.config.ts delete mode 100644 apps/docs/content/docs/.navigation.yml delete mode 100644 apps/docs/content/docs/1.getting-started/.navigation.yml delete mode 100644 apps/docs/content/docs/2.guides/.navigation.yml delete mode 100644 apps/docs/content/docs/3.configuration/.navigation.yml delete mode 100644 apps/docs/content/docs/4.reference/.navigation.yml create mode 100644 apps/docs/nimbus.json delete mode 100644 apps/docs/nuxt.config.ts create mode 100644 apps/docs/public/_headers create mode 100644 apps/docs/public/_redirects create mode 100644 apps/docs/public/favicon.ico create mode 100644 apps/docs/public/favicon.svg create mode 100644 apps/docs/src/components.ts create mode 100644 apps/docs/src/components/AgentDirective.astro create mode 100644 apps/docs/src/components/ConnectMcp.astro create mode 100644 apps/docs/src/components/Header.astro create mode 100644 apps/docs/src/components/Logo.astro create mode 100644 apps/docs/src/components/Render.astro create mode 100644 apps/docs/src/components/WebMCP.astro create mode 100644 apps/docs/src/components/connect-mcp.client.ts create mode 100644 apps/docs/src/components/logo.ts create mode 100644 apps/docs/src/components/ui/aside/Aside.astro create mode 100644 apps/docs/src/components/ui/aside/index.ts create mode 100644 apps/docs/src/components/ui/badge/Badge.astro create mode 100644 apps/docs/src/components/ui/badge/index.ts create mode 100644 apps/docs/src/components/ui/banner/Banner.astro create mode 100644 apps/docs/src/components/ui/banner/banner.client.ts create mode 100644 apps/docs/src/components/ui/banner/index.ts create mode 100644 apps/docs/src/components/ui/breadcrumbs/Breadcrumbs.astro create mode 100644 apps/docs/src/components/ui/breadcrumbs/index.ts create mode 100644 apps/docs/src/components/ui/button/Button.astro create mode 100644 apps/docs/src/components/ui/button/index.ts create mode 100644 apps/docs/src/components/ui/button/variants.ts create mode 100644 apps/docs/src/components/ui/card-grid/CardGrid.astro create mode 100644 apps/docs/src/components/ui/card-grid/index.ts create mode 100644 apps/docs/src/components/ui/card/Card.astro create mode 100644 apps/docs/src/components/ui/card/index.ts create mode 100644 apps/docs/src/components/ui/code/Code.astro create mode 100644 apps/docs/src/components/ui/code/index.ts create mode 100644 apps/docs/src/components/ui/collapsible/Collapsible.astro create mode 100644 apps/docs/src/components/ui/collapsible/CollapsibleContent.astro create mode 100644 apps/docs/src/components/ui/collapsible/CollapsibleTrigger.astro create mode 100644 apps/docs/src/components/ui/collapsible/collapsible.client.ts create mode 100644 apps/docs/src/components/ui/collapsible/index.ts create mode 100644 apps/docs/src/components/ui/dialog/Dialog.astro create mode 100644 apps/docs/src/components/ui/dialog/DialogClose.astro create mode 100644 apps/docs/src/components/ui/dialog/DialogContent.astro create mode 100644 apps/docs/src/components/ui/dialog/dialog-close.client.ts create mode 100644 apps/docs/src/components/ui/dialog/dialog.client.ts create mode 100644 apps/docs/src/components/ui/dialog/index.ts create mode 100644 apps/docs/src/components/ui/image-zoom/ImageZoom.astro create mode 100644 apps/docs/src/components/ui/image-zoom/image-zoom.client.ts create mode 100644 apps/docs/src/components/ui/image-zoom/index.ts create mode 100644 apps/docs/src/components/ui/layer-card/LayerCard.astro create mode 100644 apps/docs/src/components/ui/layer-card/LayerCardContent.astro create mode 100644 apps/docs/src/components/ui/layer-card/LayerCardHeader.astro create mode 100644 apps/docs/src/components/ui/layer-card/index.ts create mode 100644 apps/docs/src/components/ui/link-button/LinkButton.astro create mode 100644 apps/docs/src/components/ui/link-button/index.ts create mode 100644 apps/docs/src/components/ui/package-managers/PackageManagers.astro create mode 100644 apps/docs/src/components/ui/package-managers/index.ts create mode 100644 apps/docs/src/components/ui/package-managers/package-managers.client.ts create mode 100644 apps/docs/src/components/ui/page-actions/PageActions.astro create mode 100644 apps/docs/src/components/ui/page-actions/index.ts create mode 100644 apps/docs/src/components/ui/page-actions/page-actions.client.ts create mode 100644 apps/docs/src/components/ui/pagination/Pagination.astro create mode 100644 apps/docs/src/components/ui/pagination/PaginationKey.astro create mode 100644 apps/docs/src/components/ui/pagination/PaginationLink.astro create mode 100644 apps/docs/src/components/ui/pagination/index.ts create mode 100644 apps/docs/src/components/ui/pagination/pagination.client.ts create mode 100644 apps/docs/src/components/ui/search/SearchDialog.astro create mode 100644 apps/docs/src/components/ui/search/SearchTrigger.astro create mode 100644 apps/docs/src/components/ui/search/index.ts create mode 100644 apps/docs/src/components/ui/search/providers/pagefind.ts create mode 100644 apps/docs/src/components/ui/search/search-trigger.client.ts create mode 100644 apps/docs/src/components/ui/search/search.client.ts create mode 100644 apps/docs/src/components/ui/shortcuts/ShortcutsToggle.astro create mode 100644 apps/docs/src/components/ui/shortcuts/index.ts create mode 100644 apps/docs/src/components/ui/shortcuts/shortcuts-toggle.client.ts create mode 100644 apps/docs/src/components/ui/sidebar/Sidebar.astro create mode 100644 apps/docs/src/components/ui/sidebar/SidebarFilter.astro create mode 100644 apps/docs/src/components/ui/sidebar/SidebarGroup.astro create mode 100644 apps/docs/src/components/ui/sidebar/SidebarGroupHeader.astro create mode 100644 apps/docs/src/components/ui/sidebar/SidebarLink.astro create mode 100644 apps/docs/src/components/ui/sidebar/index.ts create mode 100644 apps/docs/src/components/ui/sidebar/sidebar.client.ts create mode 100644 apps/docs/src/components/ui/steps/Step.astro create mode 100644 apps/docs/src/components/ui/steps/Steps.astro create mode 100644 apps/docs/src/components/ui/steps/index.ts create mode 100644 apps/docs/src/components/ui/steps/steps.client.ts create mode 100644 apps/docs/src/components/ui/switch/Switch.astro create mode 100644 apps/docs/src/components/ui/switch/index.ts create mode 100644 apps/docs/src/components/ui/switch/switch.client.ts create mode 100644 apps/docs/src/components/ui/tabs/TabItem.astro create mode 100644 apps/docs/src/components/ui/tabs/Tabs.astro create mode 100644 apps/docs/src/components/ui/tabs/TabsContent.astro create mode 100644 apps/docs/src/components/ui/tabs/TabsList.astro create mode 100644 apps/docs/src/components/ui/tabs/TabsTrigger.astro create mode 100644 apps/docs/src/components/ui/tabs/index.ts create mode 100644 apps/docs/src/components/ui/tabs/tabs.client.ts create mode 100644 apps/docs/src/components/ui/theme-toggle/ThemeToggle.astro create mode 100644 apps/docs/src/components/ui/theme-toggle/index.ts create mode 100644 apps/docs/src/components/ui/theme-toggle/theme-toggle.client.ts create mode 100644 apps/docs/src/components/ui/toc/MobileTOC.astro create mode 100644 apps/docs/src/components/ui/toc/TOC.astro create mode 100644 apps/docs/src/components/ui/toc/index.ts create mode 100644 apps/docs/src/components/ui/toc/mobile-toc.client.ts create mode 100644 apps/docs/src/components/ui/toc/toc.client.ts create mode 100644 apps/docs/src/content.config.ts rename apps/docs/{content/docs/3.configuration/2.formatter-config.md => src/content/docs/configuration/formatter-config.md} (95%) rename apps/docs/{content/docs/3.configuration/3.lsp-config.md => src/content/docs/configuration/lsp-config.md} (93%) rename apps/docs/{content/docs/3.configuration/1.overview.md => src/content/docs/configuration/overview.mdx} (92%) rename apps/docs/{content/docs/1.getting-started/2.installation.md => src/content/docs/getting-started/installation.mdx} (63%) rename apps/docs/{content/docs/1.getting-started/1.introduction.md => src/content/docs/getting-started/introduction.md} (89%) rename apps/docs/{content/docs/1.getting-started/3.quick-start.md => src/content/docs/getting-started/quick-start.md} (85%) rename apps/docs/{content/docs/2.guides/2.auto-formatting.md => src/content/docs/guides/auto-formatting.md} (93%) rename apps/docs/{content/docs/2.guides/1.claude-code-hooks.md => src/content/docs/guides/claude-code-hooks.md} (94%) rename apps/docs/{content/docs/2.guides/3.lsp-diagnostics.md => src/content/docs/guides/lsp-diagnostics.md} (95%) rename apps/docs/{content/docs/2.guides/4.mcp-server.md => src/content/docs/guides/mcp-server.md} (92%) rename apps/docs/{content/index.md => src/content/docs/index.mdx} (57%) rename apps/docs/{content/docs/4.reference/3.api.md => src/content/docs/reference/api.md} (99%) rename apps/docs/{content/docs/4.reference/1.cli-commands.md => src/content/docs/reference/cli-commands.md} (99%) rename apps/docs/{content/docs/4.reference/2.supported-languages.md => src/content/docs/reference/supported-languages.md} (99%) create mode 100644 apps/docs/src/layouts/BaseLayout.astro create mode 100644 apps/docs/src/layouts/DocsLayout.astro create mode 100644 apps/docs/src/lib/cn.ts create mode 100644 apps/docs/src/lib/shortcuts.ts create mode 100644 apps/docs/src/lib/variants.ts create mode 100644 apps/docs/src/pages/404.astro create mode 100644 apps/docs/src/pages/[...section]/llms.txt.ts create mode 100644 apps/docs/src/pages/[...slug].astro create mode 100644 apps/docs/src/pages/[...slug]/index.md.ts create mode 100644 apps/docs/src/pages/[...slug]/index.mdx.ts create mode 100644 apps/docs/src/pages/llms-full.txt.ts create mode 100644 apps/docs/src/pages/llms.txt.ts create mode 100644 apps/docs/src/pages/nimbus-api/coordinates.json.ts create mode 100644 apps/docs/src/pages/og.png.ts create mode 100644 apps/docs/src/pages/og/[...slug].ts create mode 100644 apps/docs/src/pages/og/_card.ts create mode 100644 apps/docs/src/pages/og/_fonts/Inter-Medium.ttf create mode 100644 apps/docs/src/pages/og/_fonts/Inter-Regular.ttf create mode 100644 apps/docs/src/pages/robots.txt.ts create mode 100644 apps/docs/src/styles/globals.css create mode 100644 apps/docs/src/styles/prose.css diff --git a/apps/docs/.gitignore b/apps/docs/.gitignore index e694ccf..46f044c 100644 --- a/apps/docs/.gitignore +++ b/apps/docs/.gitignore @@ -1,28 +1,22 @@ -# Nuxt dev/build outputs -.output -.data -.nuxt -.nitro -.cache -dist +node_modules/ +dist/ +.astro/ +.wrangler/ +.nimbus/ -# Node dependencies -node_modules +.env +.env.local +.env.*.local +.env.production +.dev.vars +.dev.vars.* -# Logs -logs -*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* -# Misc .DS_Store -.fleet -.idea - -# Local env files -.env -.env.* -!.env.example - -# Wrangler -.wrangler -.dev.vars +.idea/ +.vscode/* +!.vscode/extensions.json diff --git a/apps/docs/AGENT.md b/apps/docs/AGENT.md new file mode 100644 index 0000000..f1725d1 --- /dev/null +++ b/apps/docs/AGENT.md @@ -0,0 +1,159 @@ +# This Nimbus docs site + +> `CLAUDE.md` delegates here. Keep project instructions canonical in this file. + +Astro-based docs. The `nimbus-docs` package handles content schemas, sidebar/TOC, MDX→markdown, build hooks, and the `nimbus-docs` CLI. Install dependencies first, then run it as `npx @cloudflare/nimbus-docs `: npx uses the project's installed version. Before an install, npx fetches the latest release instead, which may differ from the site's version and give different results. The scoped name keeps npx from fetching the unrelated `nimbus-docs` package. Everything in `src/` is yours to edit. + +## File layout + +``` +astro.config.ts # imports nimbus + defineNimbusConfig +nimbus.json # records the last reviewed Nimbus package version +src/ +├── components.ts # MDX globals — components every .mdx can use without an import +├── components/ # AgentDirective, Header, Logo (drawn from logo.ts), Render + ui// +├── content/ +│ ├── docs/*.mdx +│ └── partials/*.mdx # referenced via +├── content.config.ts # registers docsCollection() + partialsCollection() +├── layouts/ # BaseLayout (NimbusHead), DocsLayout (sidebar/TOC/breadcrumbs) +├── lib/cn.ts # Tailwind className merger +├── pages/ +│ ├── [...slug].astro +│ ├── [...slug]/index.md.ts # Markdown version of every page, all collections +│ ├── [...slug]/index.mdx.ts # authored source of every page, all collections +│ ├── [...section]/llms.txt.ts # per-section llms.txt, nested sections included +│ ├── 404.astro +│ ├── llms.txt.ts +│ ├── llms-full.txt.ts +│ ├── nimbus-api/coordinates.json.ts # API citation manifest +│ ├── og.png.ts # site-level OG card +│ ├── og/ +│ │ ├── _card.ts # the card's look, shared by both routes (underscore = not a route) +│ │ ├── _fonts/ # the card's fonts +│ │ └── [...slug].ts # per-page OG cards +│ └── robots.txt.ts +└── styles/ # globals.css, prose.css +``` + +Cloudflare deploys also have `wrangler.jsonc` at the project root. + +## Writing docs + +Frontmatter validates against the schema from `docsCollection()` (`@cloudflare/nimbus-docs/content`). Required: `title`. + +```mdx +--- +title: My page +description: One-line summary. +--- + +Content here. The page H1 comes from `title` — don't repeat it in the body. + +## Section heading +``` + +Rules: + +- **Components are PascalCase.** Register one in `src/components.ts` to use it in every `.mdx` without an import, or import it in the file that uses it. A pre-build validator catches unresolved names with a "did you mean" hint. +- **Partials use ``.** Don't import `.mdx` directly. Shared content lives in `src/content/partials/.mdx`. +- **Icons use Nimbus's `Icon` + Phosphor.** `` from `@cloudflare/nimbus-docs/components/Icon.astro`. Glyphs: [phosphoricons.com](https://phosphoricons.com). +- **Don't remove `` from `BaseLayout.astro`.** It points agents at `/llms.txt`. + +## Adding things + +| Goal | Action | +|---|---| +| New doc page | Create `src/content/docs/.mdx`. Sidebar picks it up. | +| New partial | Create `src/content/partials/.mdx`. Use via ``. | +| UI from registry | `npx @cloudflare/nimbus-docs add `. Register in `src/components.ts` if used in MDX. | +| Feature recipe | `npx @cloudflare/nimbus-docs add --print`. Prints the recipe for you to follow; it changes no files itself. | +| Check it builds | `npx @cloudflare/nimbus-docs check` — build-free preflight (env + structure + authoring + types). `--json` for an agent loop, `--fix` to repair what's safe. | +| Custom page route | Add a file under `src/pages/`. | +| Custom OG style | Edit `src/pages/og/_card.ts`. The card draws the logo from `src/components/logo.ts`, the same drawing as the header. | +| Check for updates | `npx @cloudflare/nimbus-docs outdated` — starter files behind their tag + registry components behind. | +| Upgrade Nimbus | Update the package, then run `npx @cloudflare/nimbus-docs migrate --dry-run --diff`. Review every change and required manual step before applying. | +| Upgrade a starter file | `npx @cloudflare/nimbus-docs diff ` to review, `diff --apply ` to pull a clean upstream change. | +| Upgrade a registry component | `npx @cloudflare/nimbus-docs add --overwrite`, then review with `git diff`. Components you edited are kept and listed. To compare one with upstream, commit, run the `--overwrite --yes` command it prints, and read `git diff`; unless the user decided to discard their edits, undo the whole run with `git checkout -- . && git clean -fd`, since it also rewrote `nimbus.json`. | + +Sätteri is Nimbus's default Markdown and MDX processor. Extend it using `markdown.mdastPlugins` for Markdown AST transformations or `markdown.hastPlugins` for HTML AST transformations. +If the site replaces Sätteri with another processor, set `admonitions: false` and keep that processor's existing callout implementation. + +List installable items: `npx @cloudflare/nimbus-docs list`. + +## Sidebar + +The sidebar mirrors `src/content/docs/`. A folder becomes a group, and its `index.mdx` is the group's landing page; set `sidebar.group.label` there to rename the group. Within a group, `sidebar.order` sorts entries (lowest first, otherwise alphabetical), `sidebar.label` shortens a page's rail title, and `sidebar.hidden: true` builds a page without listing it. + +To add an external link or fix the top-level order, set `sidebar.items` in `defineNimbusConfig` in `astro.config.ts`. Items you list replace the generated top level, and a listed item's `label` wins over the folder's `sidebar.group.label`: + +```ts +sidebar: { + items: [ + { label: "Guides", autogenerate: { directory: "guides" } }, + { label: "GitHub", link: "https://github.com/you/repo" }, + ], +}, +``` + +The header's section tabs come from the same list: each top-level item that autogenerates from another collection (`{ label: "API", autogenerate: { collection: "api", prefix: "/reference" } }`) becomes a tab, and the tabs show once there are two. Folders of `src/content/docs/` and external links stay in the sidebar. For any other header link, edit `src/components/Header.astro`. + +Everything else: . + +## Agent interfaces + +Read the release-matched guide at [`node_modules/@cloudflare/nimbus-docs/dist/docs-for-agents.md`](node_modules/@cloudflare/nimbus-docs/dist/docs-for-agents.md), especially for preview packages. Nimbus publishes discovery automatically; add project-owned Skills under `skills//SKILL.md`. Keep `` in `BaseLayout.astro` for browser-agent search with default Pagefind, and render `` in `DocsLayout.astro` only when `capabilities.mcpUrl` is set (`agents: { mcp: true }`; needs a server adapter and `@modelcontextprotocol/server`). Markdown negotiation applies to request-rendered pages; static hosting and response headers follow the deployment target's setup. + +## Upgrading Nimbus + +Keep `nimbus.json` committed. Its `lastReviewedNimbusVersion` is the baseline Nimbus uses to select the versioned reviews crossed by a package upgrade; state-detected migrations come from the current project files. It is not a package pin and should not be edited by hand. + +1. Update `@cloudflare/nimbus-docs` with the project's package manager. +2. Preview the complete plan with `npx @cloudflare/nimbus-docs migrate --dry-run --diff`. If no baseline exists yet, add `--from `. +3. Review every versioned entry and resolve each blocked/manual item. +4. Apply safe edits only with explicit consent: `npx @cloudflare/nimbus-docs migrate --yes`. Review the resulting diff, then rerun the preview. +5. When no migration remains, run `npx @cloudflare/nimbus-docs migrate --yes` again to record the completed review in `nimbus.json`. +6. Pull in starter fixes: `npx @cloudflare/nimbus-docs outdated` lists starter files that changed upstream. For each one, review it with `npx @cloudflare/nimbus-docs diff `, and take a clean update with `diff --apply `. Merge files you've edited by hand. `migrate` doesn't cover these. +7. Run the project's typecheck and production build, then run `npx @cloudflare/nimbus-docs check` again for post-build coverage. + +Except for task-printing mode (`--print`), `migrate` exits nonzero while work or review remains; that is a pending-upgrade signal, not necessarily a command failure. Never skip versions by changing `nimbus.json` directly. + +## Audit this site + +First set `site` in `astro.config.ts` to the production URL; a fresh site still has the placeholder. Ask the user for the URL if you don't know it, and never make one up. + +Then run `npx @cloudflare/nimbus-docs check --json`. It runs the environment, structural, authoring, and type checks build-free — config validity, `site` placeholder, route collisions, MDX component resolution, the lint rules, and a `tsc` type-check — and returns three top-level signals plus per-scope detail: + +- **`status`** (`passed` | `failed` | `partial`) and **`readiness`** (`buildable` | `blocked` | `unknown`) are the primary signals. `status` is the whole-run verdict; `readiness` answers "does env + structure say it builds?". `ok` (=== zero errors) is kept for back-compat only. +- **`findings[{scope,code,severity,file,line,message,fixable,fix}]`** are problems we evaluated. Apply each `fix` (or `check --fix`). +- **`scopes[].notes[{code,reason,requiresBuild?,requiresInput?}]`** are checks we *couldn't* evaluate yet (e.g. types before a build). A note is never a finding and never carries a `fix` — you resolve it by making the missing thing exist (usually a build), not by `--fix`. `summary.notes` counts them. + +Loop until `status !== "failed"` and no finding has a `fix` without `fix.requiresInput` — `summary.fixable` also counts fixes that need input (a placeholder `site`), which `--fix` can't apply for you. An error with no `fix` (such as `nimbus/dependencies-missing`) ends the loop too: do what its message says (install dependencies), then run `check` again, or stop and report it. A `partial` run with nothing left to fix is a **stop** (optionally build, then re-check), not a `--fix` retry. Exit is `1` only when `status` is `"failed"`. For full coverage (types + link-checking) run a build first, then `check` again. With server output, `check` stays `partial` with the note `nimbus/request-rendering-build-required` even after a build: it doesn't verify request-rendered pages, so a passing production build is the gate. + +Then walk the categories below for what `check` doesn't cover yet — route-file existence, registry hygiene, the AI surface, post-build search, and Cloudflare config. Emit findings as: + +``` +- [error|warn|info] FILE:LINE — what + why + fix. +``` + +End with `Summary: N errors, N warnings.` + +- **Config** — `astro.config.ts` calls `nimbus(defineNimbusConfig({ ... }))`; `site` is set; `editPattern` (if set) contains `{path}`; `output:` matches the deploy target. +- **Content** — `content.config.ts` registers `docsCollection()` (and `partialsCollection()` if used); every `.mdx` is inside a registered collection; frontmatter validates. +- **Sidebar** — every sidebar ref resolves to a content entry; no orphans; no slug collisions. +- **MDX** — every PascalCase component in `*.mdx` is registered or imported; every `` resolves; code-fence languages are valid. +- **Routes** — `llms.txt.ts`, `robots.txt.ts`, `[...slug]/index.md.ts`, `og.png.ts`, `og/[...slug].ts` all exist. +- **Registry hygiene** — every `src/components/ui//` is either MDX-registered or imported in `src/`; transitive deps (`lib/cn.ts`, etc.) exist. +- **AI surface** — `` renders in `BaseLayout.astro`; doc `` has ``. +- **Search** — `data-pagefind-body` is on the docs main wrapper; after a production build, `dist/pagefind/` exists with ≥1 indexed page. +- **Cloudflare** (if applicable) — `wrangler.jsonc` has `name` and `compatibility_date`. Static output: `assets.directory = "./dist"` and `assets.not_found_handling = "404-page"`. Server output (`@astrojs/cloudflare`): no `assets.directory` or `main`; the adapter writes the deploy config to `dist/server/wrangler.json` at build time, so check that file after a build. + +## Don't + +- Hand-add components under `src/components/ui/` that exists in the Nimbus registry — use `npx @cloudflare/nimbus-docs add ` so deps resolve. +- Import `.mdx` files directly — use ``. +- Remove `` unless asked. + +## Project home + +[nimbus-docs.com](https://nimbus-docs.com) diff --git a/apps/docs/CLAUDE.md b/apps/docs/CLAUDE.md new file mode 100644 index 0000000..a16fea4 --- /dev/null +++ b/apps/docs/CLAUDE.md @@ -0,0 +1,3 @@ +# This Nimbus docs site + +Read and follow [AGENT.md](./AGENT.md). It is the canonical project guidance for editing, auditing, upgrading, and validating this Nimbus site. diff --git a/apps/docs/app/app.config.ts b/apps/docs/app/app.config.ts deleted file mode 100644 index faf6ed2..0000000 --- a/apps/docs/app/app.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default defineAppConfig({ - docs: { - title: 'Code Please', - description: 'Auto-format and type-check hooks for AI coding', - github: { - owner: 'chatbot-pf', - name: 'code-please', - url: 'https://github.com/chatbot-pf/code-please', - branch: 'main', - }, - }, -}) diff --git a/apps/docs/astro.config.ts b/apps/docs/astro.config.ts new file mode 100644 index 0000000..6435374 --- /dev/null +++ b/apps/docs/astro.config.ts @@ -0,0 +1,51 @@ +import { defineConfig } from "astro/config"; +import tailwindcss from "@tailwindcss/vite"; +import nimbus, { + defineConfig as defineNimbusConfig, +} from "@cloudflare/nimbus-docs"; +import { tableScroll } from "@cloudflare/nimbus-docs/markdown"; + +const nimbusConfig = defineNimbusConfig({ + site: "https://code-please.pages.dev", + title: "Code Please", + description: "Auto-format and type-check hooks for AI coding", + locale: "en", + github: "https://github.com/pleaseai/code-intelligence", + socialImageAlt: "Code Please documentation preview", + sidebar: { + items: [ + "index", + { label: "Getting Started", autogenerate: { directory: "getting-started" } }, + { label: "Guides", autogenerate: { directory: "guides" } }, + { label: "Configuration", autogenerate: { directory: "configuration" } }, + { label: "Reference", autogenerate: { directory: "reference" } }, + ], + }, +}); + +export default defineConfig({ + // nimbus:adapter + output: "static", + vite: { + plugins: [tailwindcss()], + }, + prefetch: { + prefetchAll: true, + defaultStrategy: "hover", + }, + integrations: [ + nimbus(nimbusConfig, { + rules: { + "nimbus/frontmatter-shape": "error", + "nimbus/internal-link": "error", + }, + markdown: { + hastPlugins: [tableScroll()], + // `## Install {#install}` gives a heading a fixed id. A heading that + // ends in other `{…}` text, such as `{account_id}` in a .md file, is + // read as attributes too; remove this to keep it as text. + features: { headingAttributes: true }, + }, + }), + ], +}); diff --git a/apps/docs/content/docs/.navigation.yml b/apps/docs/content/docs/.navigation.yml deleted file mode 100644 index d408b20..0000000 --- a/apps/docs/content/docs/.navigation.yml +++ /dev/null @@ -1 +0,0 @@ -title: Documentation diff --git a/apps/docs/content/docs/1.getting-started/.navigation.yml b/apps/docs/content/docs/1.getting-started/.navigation.yml deleted file mode 100644 index bcd2ba1..0000000 --- a/apps/docs/content/docs/1.getting-started/.navigation.yml +++ /dev/null @@ -1 +0,0 @@ -title: Getting Started diff --git a/apps/docs/content/docs/2.guides/.navigation.yml b/apps/docs/content/docs/2.guides/.navigation.yml deleted file mode 100644 index e945492..0000000 --- a/apps/docs/content/docs/2.guides/.navigation.yml +++ /dev/null @@ -1 +0,0 @@ -title: Guides diff --git a/apps/docs/content/docs/3.configuration/.navigation.yml b/apps/docs/content/docs/3.configuration/.navigation.yml deleted file mode 100644 index 4a37d36..0000000 --- a/apps/docs/content/docs/3.configuration/.navigation.yml +++ /dev/null @@ -1 +0,0 @@ -title: Configuration diff --git a/apps/docs/content/docs/4.reference/.navigation.yml b/apps/docs/content/docs/4.reference/.navigation.yml deleted file mode 100644 index 77899da..0000000 --- a/apps/docs/content/docs/4.reference/.navigation.yml +++ /dev/null @@ -1 +0,0 @@ -title: Reference diff --git a/apps/docs/nimbus.json b/apps/docs/nimbus.json new file mode 100644 index 0000000..2e3a165 --- /dev/null +++ b/apps/docs/nimbus.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://nimbus-docs.com/schema/nimbus.json", + "version": "0.9.0", + "lastReviewedNimbusVersion": "0.20.0", + "templatesTag": "templates-v0.9.0", + "variant": "starter", + "registry": "https://nimbus-docs.com/registry", + "install": { + "root": "src", + "aliases": { + "@/*": "src/*" + } + }, + "components": [] +} diff --git a/apps/docs/nuxt.config.ts b/apps/docs/nuxt.config.ts deleted file mode 100644 index afd5cc1..0000000 --- a/apps/docs/nuxt.config.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { defineNuxtConfig } from 'nuxt/config' - -export default defineNuxtConfig({ - extends: ['docs-please'], - site: { - name: 'Code Please Docs', - url: 'https://code-please.pages.dev', - }, - content: { - database: { - type: 'd1', - bindingName: 'DB', - }, - }, - routeRules: { - '/': { prerender: true }, - }, - compatibilityDate: '2025-12-21', - nitro: { - preset: 'cloudflare_pages', - cloudflare: { - deployConfig: true, - nodeCompat: true, - }, - }, - llms: { - domain: 'https://code-please.pages.dev', - title: 'Code Please', - description: 'Auto-format and type-check hooks for AI coding', - full: { - title: 'Code Please Documentation', - description: 'Complete documentation for @pleaseai/code - Auto-format and type-check hooks for AI coding', - }, - }, -}) diff --git a/apps/docs/package.json b/apps/docs/package.json index 8d8b4a0..62aa265 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -1,23 +1,40 @@ { "name": "@pleaseai/code-please-docs-site", - "type": "module", + "version": "0.0.1", "private": true, + "type": "module", "scripts": { - "dev": "NITRO_PRESET=node_server nuxt dev", - "build": "nuxt build", - "generate": "nuxt generate", - "preview": "nuxt preview", - "postinstall": "" + "dev": "astro dev", + "build": "astro build", + "preview": "astro preview", + "typecheck": "astro check", + "lint:docs": "nimbus-docs lint", + "lint:docs:fix": "nimbus-docs lint --fix", + "prepreview:cf": "astro build", + "preview:cf": "wrangler pages dev ./dist", + "predeploy": "astro check && astro build", + "deploy": "wrangler pages deploy ./dist" }, "dependencies": { - "better-sqlite3": "^12.2.0", - "docs-please": "^0.2.6", - "nuxt": "^4.5.2", - "zod": "^4.4.3", - "zod-to-json-schema": "^3.25.0" + "@cloudflare/nimbus-docs": "^0.20.0", + "@fontsource-variable/inter": "^5.3.0", + "@fontsource-variable/jetbrains-mono": "^5.3.0", + "@iconify-json/ph": "^1.2.2", + "@resvg/resvg-js": "^2.6.2", + "astro": "7.4.2", + "clsx": "^2.1.1", + "satori": "^0.63.2", + "sharp": "^0.35.5", + "tailwind-merge": "^3.7.0" }, "devDependencies": { + "@astrojs/check": "^0.9.12", + "@astrojs/language-server": "2.17.3", + "@emnapi/runtime": "1.11.3", "@tailwindcss/vite": "^4.3.3", - "typescript": "^6.0.3" + "pagefind": "^1.5.2", + "tailwindcss": "^4.3.3", + "typescript": "^6.0.3", + "wrangler": "^4.95.0" } } diff --git a/apps/docs/public/_headers b/apps/docs/public/_headers new file mode 100644 index 0000000..4e06385 --- /dev/null +++ b/apps/docs/public/_headers @@ -0,0 +1,4 @@ +# Hashed build files never change, so browsers keep them for a year without +# asking again. Hosts that don't read _headers ignore this file. +/_astro/* + Cache-Control: public, max-age=31536000, immutable diff --git a/apps/docs/public/_redirects b/apps/docs/public/_redirects new file mode 100644 index 0000000..599e6d7 --- /dev/null +++ b/apps/docs/public/_redirects @@ -0,0 +1 @@ +/docs/* /:splat 301 diff --git a/apps/docs/public/favicon.ico b/apps/docs/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..b35a3628eed74e6ba7560ccdc4b42edd028705d6 GIT binary patch literal 2976 zcmaKsS5(tm7RLYdmQVtrBQ2D`rAGpy^w6XWD2P<4m)->h0-}jDk=`RH!le_6NRbv$ zPzg;yiXc^`7paoT%)M)#X3fJn`|R)RwO_vV{Q!UhpaNJ~0df@rK2rdIG5`QVLVx%D zQ~&^?1OR#Yzxz)#05D2ESaVZ-Fe5J`c@%7DpleC4-EN3%xDk}b^xSf7N2*OjNMsBrM}>yC_AKmVqIi#LT*OBD8vn4IUl z_+h`kFIe<>T3Z(e^RMxaN;pn5ZweYd z8-2KXyV?eIS26eM3wEIP8{(^b?WFXNHy0CfHIjqss2_!E^@=06HP?(l@9c_=cOYW4Jp6VEhLxRX*N>1k ztgiL9j90g~z`YSi@97r!b|c!Ee=Vj@c8AHQFRx*%12Iv?4s6jq$_z9g7!Iy&FFf+o zhZ)CJta}_l)AKeQMFt2p=xGrS^9z#4DcMC53B6l#N_L0#-?mTz1Pxpws8XSstN?~6 zQ{5VEr?~&&su1~G=s&IoM@Ak109DlAu5M&G8jM+R3~Wcw| zsL3kbC=&ndQq?*^Xz(#T1Lb=JeM31;=*2op^33(oHF&PovE_7p=I>Hnr1ET8zTX@5 z@S42+;WC*A(`bBf`0!EDe#cQ!RLo7b{Xd@McrdWjvlB77SSeXq+1sTf%dK;M)kZIa zoE?u251YQ>6Kye4+^mL^X$PDiL69(~VqC5#BdnpW_W*gN@Y9kz{)F#1q{;41k{n$z zZ?S+c>SvPP(l8I3fwA!)J>y9!DMd~JqP{J)8sg&O>WYd%$oHSpx-enVPoBkhB%i4- zJ%Xilisdi{_#R8yHf=FbLm&`N=RJx{Tu{^-iZ$n8o*g(aasj921n;FaX8lVX-a433(LZM~ok-akO&on3hv}=BxYqyUXVVyQTPrPsBI0vL>XoVSUB}IoGIjT4!Aq zR8)?gAsejkXC6APkSgV;DHWPKv=`e4l}<<8@jL{6`a^LhHOD0Ax38`kQ81p)gZdYZ zl0T<#*3{IL@0G$Dv^&=>zTOXt#T%Rwqh>GYD}x|J6r1+*`7a85?J@Zn#}}*OZP$Zj z7{W&abJzn>l@oTrRY7j1zwSO=fSDELJmn02Y9)lLgs@O_LX+hEZ(2{iqLxPH8W*}$MSLPU>cy~p zUM9%mI^tH7)6&xR)l->IPUcem;hQaCZ5;&frj)jw{tmjFU6(E|^*c6kp%^TLAuSo^ zpmWC5%r&Eszl}0CYaqcFJ?`anwX+|Sxl1Ay979scnfxck#Kp(SU*~cI$;$srF`3?g z{C`q>lk(&-0MNw$lj7WaKI15k0gslMvH8trA*u2a7jMu=Nsy!zZ##Rbmt;AtM8PUf z*VUr^f{g>=4YN1u3wU@d(lPU{3QdZVI^c?)r6q<<0&0{Luh zZ20iYP+6`Y1oIYaEy+b*EeiE(X;UiD3=G^&hQs0hY3=r04;UxL`o|j6N;7>EHsezA zbd{b*ovgYXE5H3pf+-zm^I|C^Ns2xSL(Vo)QD-d{m_g6l1dS?amKWrLX8N+PuWzXH zX#vAbR}0Eq?Dv-CBFL$)|I6kt8ra(Cdz7APPxKyqrzzxCwF_{)7Oh;vMuj_(-1mb8 zB_t%Ys$e$XnWFp{eo0B`j+zb z`e1`cjuo8W#d)=U+0ktX^!aDsO52!vhgdA#`Y zz9=pB=WKNekRKrJQ~5+d7Erl{qLdxOc;oRidSnwZKj4TU;bji(2 zZoe;~l`HV6U4Ln@tOY!}>{!8sEHu7{rWWFePF_Y5rHY5cL(8wL@o5e)g($MJ3cT5o zT1*PkQE|4JxH0G=kAZ%Ro-Rh?ye1RYex4Rv-xmcx%US4-7f7R2&~(wl-rYgyTl4pR z51Aic_ejskgzPvqJY1gLqr($dgIeEM6=>7lRMmOEH|>&9%!J1sfUY1vaD z@YCY}L@4!K;N0BYTcg5i98M@zNbFBY${af zjI!$mqerLh0!t~l22a0KLVyjFYU29@gOE;R(9`^O|+o4iV1O9_&?;5&SqRliw6S1F)k z%cG+9v$q>-!Q2`QC(yEze0k5o@5{&T37w)$4lP3+oHTjx_J@OX)(;nEyzf#9^f2Y1 z8KE>es!OIq*%|RyI!xm}!*v^OdHes!X2te1?Pk&W*yZL|Ov#{`)C-?*LTM3=+`se; zcEgDu3`CH7GfsFhlj42cZ*HsFxLVdtNn|Q|4t_@YK=FALu64YS>TvG?cq=sd-HdVa zCyVZUOF8gWU8<(%0!o`LV?+_ptgUlb7lO8*esP+N#9K4R@uP%6qsBFiqJB+P+4T`4 z4%-qsi}^?16>3KuVS>wN$+L;byyCzVHKy-w^>#>E{Xds%1KQ_(c&^0I+x2+Hlz{nk zen+nR$w+e@Z9dIzjNkitSel6rTW4Di&p8_&8j@b{Zp-k0T&lhY294^oY51(Hu5ykV zK$ESE23Ad1?y*La?&3?qxhWs^Slz%V<{?G5Fw*juH_?rzouZL^$#gIh%dO-W6gHw> ou@eToPM0C`u_Q8*Nu+PR4U6Q*KQxb14|pN0)2l;P{!8 diff --git a/apps/docs/src/components.ts b/apps/docs/src/components.ts new file mode 100644 index 0000000..7d22358 --- /dev/null +++ b/apps/docs/src/components.ts @@ -0,0 +1,21 @@ +import { Aside } from "./components/ui/aside"; +import Render from "./components/Render.astro"; +import { Card } from "./components/ui/card"; +import { CardGrid } from "./components/ui/card-grid"; +import { LinkButton } from "./components/ui/link-button"; +import { PackageManagers } from "./components/ui/package-managers"; +import { Step, Steps } from "./components/ui/steps"; +import { Tabs, TabItem } from "./components/ui/tabs"; + +export const components = { + Aside, + Card, + CardGrid, + LinkButton, + PackageManagers, + Render, + Step, + Steps, + TabItem, + Tabs, +}; diff --git a/apps/docs/src/components/AgentDirective.astro b/apps/docs/src/components/AgentDirective.astro new file mode 100644 index 0000000..0d3395d --- /dev/null +++ b/apps/docs/src/components/AgentDirective.astro @@ -0,0 +1,37 @@ +--- +interface Props { + /** Absolute or site-relative URL for this page's markdown version, or + * `null` when the page has no per-page Markdown (a non-default + * query-mode API version) — the directive then points at the index only. */ + markdownUrl?: string | null; + /** Absolute or site-relative URL for the top-level llms.txt index, or + * `null` when no route of the site serves one. */ + llmsUrl?: string | null; +} + +const { markdownUrl, llmsUrl } = Astro.props; +--- + +{/* Read by screen readers and agents; out of the Tab order, so keyboard users + don't land on links they can't see. Nothing to point at, nothing said. */} +{(markdownUrl || llmsUrl) && ( + +)} diff --git a/apps/docs/src/components/ConnectMcp.astro b/apps/docs/src/components/ConnectMcp.astro new file mode 100644 index 0000000..ea716a8 --- /dev/null +++ b/apps/docs/src/components/ConnectMcp.astro @@ -0,0 +1,28 @@ +--- +import { capabilities } from "virtual:nimbus/agent-capabilities"; +import Icon from "@cloudflare/nimbus-docs/components/Icon.astro"; +import { cn } from "@/lib/cn"; +import type { HTMLAttributes } from "astro/types"; + +type Props = HTMLAttributes<"div">; + +const { class: className, ...attrs } = Astro.props; +const url = capabilities.mcpUrl; + +const actionBtn = + "inline-flex cursor-pointer items-center gap-1.5 rounded-md bg-transparent px-2 py-1 text-muted-foreground no-underline transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2"; +--- + +{url && ( +
+ + +
+)} + + diff --git a/apps/docs/src/components/Header.astro b/apps/docs/src/components/Header.astro new file mode 100644 index 0000000..ea24295 --- /dev/null +++ b/apps/docs/src/components/Header.astro @@ -0,0 +1,147 @@ +--- +import Logo from "./Logo.astro"; +import type { SidebarSection } from "@cloudflare/nimbus-docs/types"; +import Icon from "@cloudflare/nimbus-docs/components/Icon.astro"; +import { Button } from "./ui/button"; +import { LinkButton } from "./ui/link-button"; +import { ThemeToggle } from "./ui/theme-toggle"; +import SearchTrigger from "./ui/search/SearchTrigger.astro"; +import { ShortcutsToggle } from "./ui/shortcuts"; +import { config } from "virtual:nimbus/config"; +import { getCollectionUrl, getSidebarSections, stripBase, withBase } from "@cloudflare/nimbus-docs/runtime"; + +interface Props { + /** Astro collection id for the current page, forwarded from DocsLayout. */ + collection?: string; + /** Astro entry id for the current page, forwarded from DocsLayout. */ + entryId?: string; + /** + * Whether the page has a sidebar to open. When `false`, the mobile + * menu button is hidden — pages that opted out via `sidebar: false` + * shouldn't show a button that opens an empty dialog. Default `true`. + */ + showSidebar?: boolean; + sections?: SidebarSection[]; +} + +// `entryId` is part of Props as a forward-compat hook (the version-switcher +// recipe reads it) but the base Header doesn't use it — leave it off the +// destructure to avoid an unused-var warning. +const { collection, showSidebar = true, sections: sectionsProp } = Astro.props; + +// Normalize trailing slash so isActive matches sidebar hrefs. +const currentSlug = stripBase(Astro.url.pathname, import.meta.env.BASE_URL).replace(/\/$/, "") || "/"; +const sidebarSections = + sectionsProp ?? (await getSidebarSections(currentSlug, { collection })); +// An API reference beside the docs isn't in the docs sidebar, so the docs and +// each reference become the tabs. A reference served at the root is the site. +const apiHrefs = ( + await Promise.all((config.api ?? []).map(async (entry) => ({ entry, href: await getCollectionUrl(entry.collection) }))) +).filter(({ href }) => href !== "/"); +// The reference the page is in: the longest mount that is the path or a folder of it. +const mountOf = (href: string) => href.replace(/\/$/, ""); +const activeApi = apiHrefs + .filter(({ href }) => currentSlug === mountOf(href) || currentSlug.startsWith(`${mountOf(href)}/`)) + .sort((a, b) => b.href.length - a.href.length)[0]; +const sections = + sidebarSections.length >= 2 || sectionsProp || apiHrefs.length === 0 + ? sidebarSections + : [ + // A page outside every collection (the 404) is in neither tab. + { label: "Docs", href: "/", isActive: activeApi === undefined && collection !== undefined }, + ...apiHrefs.map((api) => ({ + label: apiHrefs.length === 1 ? "API reference" : (api.entry.label ?? api.entry.collection), + href: api.href, + isActive: api === activeApi, + })), + ]; +const showSections = sections.length >= 2; +const homeHref = withBase("/", import.meta.env.BASE_URL); +const resolveSectionHref = (href: string): string => + withBase(href, import.meta.env.BASE_URL); +--- + +
+
+
+ + {/* The mark alone; the site title stays as the link's accessible name. */} + + + {config.title} + + + + {showSections && ( + + )} +
+ +
+ + {config.search !== false && } + {/* Without search, the reader's single-key switch lives here. */} + {config.search === false && } + {config.github && ( + + + + )} + + {showSidebar && ( +
+
+ {/* Phones: the tabs on a row of their own under the bar. */} + {showSections && ( + + )} +
diff --git a/apps/docs/src/components/Logo.astro b/apps/docs/src/components/Logo.astro new file mode 100644 index 0000000..2aeddf3 --- /dev/null +++ b/apps/docs/src/components/Logo.astro @@ -0,0 +1,10 @@ +--- +/* The site's logo, inline so it takes the text colour in light and dark. The + drawing lives in logo.ts, which the social cards read too. */ +import { logo } from "./logo"; + +interface Props { class?: string } +// Callers give it a whole-pixel box and the drawing centres inside. +const { class: cls = "h-5 w-8" } = Astro.props; +--- + diff --git a/apps/docs/src/components/Render.astro b/apps/docs/src/components/Render.astro new file mode 100644 index 0000000..536be91 --- /dev/null +++ b/apps/docs/src/components/Render.astro @@ -0,0 +1,107 @@ +--- +/** + * Render — include a reusable partial in any docs page. + * + * + * + * + * Partials live in `src/content/partials/` as MDX. Declare params in + * partial frontmatter (`params: [runtime, version?]`); required params + * fail at build time, optional use a `?` suffix. + */ +import { getVisibleEntries, getVisibleEntry } from "@cloudflare/nimbus-docs/runtime"; +import { render } from "astro:content"; +import { components } from "../components"; + +interface Props { + /** Partial ID — path relative to src/content/partials/ without extension. */ + file: string; + /** Parameters passed to the partial as props. */ + params?: Record; +} + +const { file, params } = Astro.props; +const page = Astro.url.pathname; +const partial = await getVisibleEntry("partials", file); + +if (!partial) { + const allPartials = await getVisibleEntries(["partials"]); + const partialIds = allPartials.map((p) => p.id); + const hint = closest(file, partialIds); + const shortList = partialIds.sort().slice(0, 10).join(", "); + const tail = + partialIds.length > 10 + ? ` (and ${partialIds.length - 10} more)` + : partialIds.length === 0 + ? "none" + : ""; + throw new Error( + `[Render] Partial "${file}" not found, included on "${page}".` + + (hint ? ` Did you mean "${hint}"?` : "") + + ` Available: ${shortList}${tail}`, + ); +} + +const declaredParams = partial.data.params; +if (declaredParams) { + const required = declaredParams.filter((param: string) => !param.endsWith("?")); + const optional = declaredParams.filter((param: string) => param.endsWith("?")); + const allNames = [...required, ...optional.map((param: string) => param.slice(0, -1))]; + const received = Object.keys(params ?? {}); + + const missing = required.filter((param: string) => !received.includes(param)); + if (missing.length > 0) { + throw new Error( + `[Render] Missing required params ${JSON.stringify(missing)} for "${file}" on "${page}". ` + + `Expected: ${JSON.stringify(declaredParams)}, received: ${JSON.stringify(received)}`, + ); + } + + const unexpected = received.filter((param) => !allNames.includes(param)); + if (unexpected.length > 0) { + const unexpectedHints = unexpected + .map((u) => { + const h = closest(u, allNames); + return h ? `"${u}" (did you mean "${h}"?)` : `"${u}"`; + }) + .join(", "); + throw new Error( + `[Render] Unexpected params ${unexpectedHints} for "${file}" on "${page}". ` + + `Declared: ${JSON.stringify(declaredParams)}`, + ); + } +} + +const { Content } = await render(partial); + +/** Levenshtein distance — inlined to keep this component dep-free. */ +function distance(a: string, b: string): number { + if (a === b) return 0; + if (!a.length) return b.length; + if (!b.length) return a.length; + const v0 = new Array(b.length + 1); + const v1 = new Array(b.length + 1); + for (let i = 0; i <= b.length; i++) v0[i] = i; + for (let i = 0; i < a.length; i++) { + v1[0] = i + 1; + for (let j = 0; j < b.length; j++) { + const cost = a[i] === b[j] ? 0 : 1; + v1[j + 1] = Math.min(v1[j] + 1, v0[j + 1] + 1, v0[j] + cost); + } + for (let j = 0; j <= b.length; j++) v0[j] = v1[j]; + } + return v1[b.length]; +} + +function closest(target: string, candidates: string[], maxDist = 3): string | null { + const t = target.toLowerCase(); + let best: { name: string; dist: number } | null = null; + for (const c of candidates) { + const d = distance(t, c.toLowerCase()); + if (d <= maxDist && (!best || d < best.dist)) best = { name: c, dist: d }; + } + return best?.name ?? null; +} +--- + + diff --git a/apps/docs/src/components/WebMCP.astro b/apps/docs/src/components/WebMCP.astro new file mode 100644 index 0000000..745abfb --- /dev/null +++ b/apps/docs/src/components/WebMCP.astro @@ -0,0 +1,24 @@ +--- +import { capabilities, options } from "virtual:nimbus/agent-capabilities"; +import { searchIndex } from "virtual:nimbus/config"; +--- + +{capabilities.search === "pagefind" && ( + +)} + + diff --git a/apps/docs/src/components/connect-mcp.client.ts b/apps/docs/src/components/connect-mcp.client.ts new file mode 100644 index 0000000..fb47847 --- /dev/null +++ b/apps/docs/src/components/connect-mcp.client.ts @@ -0,0 +1,38 @@ +import { mount } from "@cloudflare/nimbus-docs/client"; + +const RESET_MS = 1500; + +function initConnectMcp(root: HTMLElement): () => void { + const button = root.querySelector("[data-nb-connect-mcp-copy]"); + const label = root.querySelector("[data-nb-connect-mcp-label]"); + const status = root.querySelector("[data-nb-connect-mcp-status]"); + const url = button?.dataset.copy; + if (!button || !label || !url) return () => {}; + + const idle = label.textContent; + let timer: number | undefined; + const onCopy = async () => { + let copied = true; + try { + await navigator.clipboard.writeText(url); + } catch { + copied = false; + } + if (!root.isConnected) return; + label.textContent = copied ? "Copied" : "Couldn't copy"; + if (status) status.textContent = copied ? "MCP server URL copied" : "Couldn't copy the MCP server URL"; + if (timer !== undefined) window.clearTimeout(timer); + timer = window.setTimeout(() => { + label.textContent = idle; + if (status) status.textContent = ""; + }, RESET_MS); + }; + button.addEventListener("click", onCopy); + + return () => { + button.removeEventListener("click", onCopy); + if (timer !== undefined) window.clearTimeout(timer); + }; +} + +mount("[data-nb-connect-mcp]", initConnectMcp); diff --git a/apps/docs/src/components/logo.ts b/apps/docs/src/components/logo.ts new file mode 100644 index 0000000..aeeaa78 --- /dev/null +++ b/apps/docs/src/components/logo.ts @@ -0,0 +1,12 @@ +/** + * The site's logo, drawn once for every place it appears: the header and the + * docs layout (Logo.astro) and the social cards (src/pages/og/_card.ts). + * Replace the drawing here to rebrand them all. Keep it a single-colour + * mark; each place fills it with its own text colour. + */ +export const logo = { + /** The drawing's box; callers size it by height and keep the ratio. */ + width: 311, + height: 184, + paths: ["M272.1 99.6C272.1 99.6 274.8 99.8 280.1 100.3C285.5 100.8 289.6 101.5 292.6 102.6C295.5 103.7 298.4 105.6 301.3 108.4C304.2 111.1 306.2 113.7 307.3 116.2C308.3 118.6 309.1 121.3 309.6 124.1C310.1 127 310.3 130.2 310.1 133.5C309.9 136.8 309 140.2 307.5 143.7C306 147.2 303.8 150.5 301 153.5C298.2 156.5 295.1 159.1 291.8 161.3C288.4 163.6 283.4 165.9 276.7 168.4C270.1 170.9 265.5 172.5 263 173.2C260.4 173.8 257.1 174.4 252.8 174.8C248.5 175.3 244.5 175.1 240.7 174.2C236.9 173.3 233.4 171.9 230.3 169.9C227.1 168 224.4 165.7 221.9 163.2C219.5 160.7 216.6 156.5 213.2 150.6C209.8 144.8 208.1 141.9 208.1 141.9C207.1 140 207 137.8 207.7 135.8C208.4 133.8 209.8 132.1 211.7 131.2C213.6 130.2 215.8 130.1 217.8 130.8C219.8 131.5 221.5 132.9 222.4 134.8C222.4 134.8 223.3 136.8 225.1 140.7C226.8 144.6 228.5 147.7 229.9 149.9C231.4 152.1 232.9 154 234.6 155.7C236.3 157.3 238.1 158.8 240 160C242 161.2 244.3 162 247 162.5C249.6 162.9 253 162.9 257.1 162.3C261.2 161.8 264.6 161 267.3 160.1C270 159.3 272.7 158.1 275.5 156.8C278.3 155.4 281 153.8 283.4 151.9C285.8 150 287.9 148 289.6 146C291.3 144 292.7 141.1 293.6 137.1C294.5 133.2 294.4 129.4 293.2 125.7C292 122 290.3 119.5 288.2 118.3C286.1 117.1 282.9 116.3 278.5 115.9C274.2 115.5 272.1 115.3 272.1 115.3C270 115.3 268 114.5 266.5 113C265.1 111.5 264.2 109.5 264.2 107.4C264.2 105.4 265.1 103.4 266.5 101.9C268 100.4 270 99.6 272.1 99.6ZM221.7 143C221.7 143 219.9 145.7 216.4 151.1C212.8 156.5 210 160.3 207.9 162.6C205.8 165 203.3 167.2 200.5 169.5C197.6 171.8 194.5 173.9 191.1 175.7C187.7 177.5 184.1 179 180.2 180.2C176.4 181.3 172.3 182.1 167.8 182.7C163.4 183.2 157.8 183.4 151 183.2C144.2 183.1 139.5 182.7 136.9 182.2C134.4 181.6 130.9 180.3 126.6 178.2C122.2 176.1 118.4 173.7 115.2 170.9C112 168.2 109.5 165.6 107.6 163.3C105.6 161 104.1 158.5 102.9 155.9C101.7 153.4 101.3 150 101.7 145.8C102 141.6 102.2 139.5 102.2 139.5C103 137.5 104.5 136 106.4 135.2C108.3 134.3 110.5 134.3 112.4 135.1C114.3 135.9 115.9 137.4 116.7 139.3C117.5 141.2 117.6 143.4 116.8 145.3C116.8 145.3 116.5 145.7 115.9 146.5C115.4 147.3 115.5 148.8 116.4 151.1C117.3 153.5 118.6 155.7 120.4 158C122.1 160.2 124.4 162.4 127 164.6C129.7 166.8 132.9 168.6 136.5 170.1C140.1 171.6 143.1 172.5 145.5 172.8C148 173.1 151 173.2 154.4 172.9C157.9 172.7 161.5 172.3 165.2 171.6C168.9 170.9 172.2 170.1 175.1 168.9C178.1 167.8 180.8 166.4 183.3 164.8C185.8 163.2 188.1 161.4 190.1 159.4C192.1 157.4 195.8 152.6 201 145C206.2 137.4 208.8 133.7 208.8 133.7C210 131.9 211.9 130.8 214 130.5C216.1 130.1 218.2 130.6 219.9 131.9C221.7 133.1 222.8 135 223.1 137.1C223.5 139.2 223 141.3 221.7 143ZM117.1 144.2C117.1 144.2 117 145 116.6 146.7C116.2 148.4 114.5 151.4 111.5 155.8C108.4 160.1 105.4 163.5 102.3 166C99.2 168.5 95.7 170.8 91.7 173C87.7 175.3 83.5 177.1 78.9 178.7C74.4 180.2 69.9 181.4 65.4 182C60.9 182.7 56.8 183 53 183C49.2 182.9 45.5 182.5 42.1 181.7C38.6 180.9 35.4 179.9 32.5 178.6C29.5 177.2 26.8 175.7 24.4 174C22 172.2 19 169.3 15.6 165.3C12.2 161.3 9.5 157.2 7.6 153.2C5.6 149.2 4 144.9 2.8 140.5C1.6 136.1 .8 132.6 .6 130.1C.4 127.5 .4 124.9 .8 122.1C1.2 119.3 2 116.5 3.3 113.9C4.7 111.2 6.4 108.8 8.5 106.8C10.6 104.7 13 103 15.6 101.7C18.2 100.4 22 99.2 27.1 98.1C32.2 97.1 36.5 96.7 40 96.8C43.5 97 46.3 97.3 48.6 97.9C50.9 98.4 53.3 99.3 55.8 100.6C58.4 101.8 59.7 102.4 59.7 102.4C61.5 103.4 62.9 105 63.5 107C64.1 108.9 63.9 111.1 63 112.9C62.5 113.8 61.9 114.6 61.1 115.2C60.3 115.9 59.4 116.4 58.4 116.7C56.5 117.3 54.3 117.1 52.5 116.2C52.5 116.2 50.9 115.4 47.7 113.8C44.6 112.2 41.9 111.3 39.6 111C37.3 110.6 34.4 110.8 30.8 111.3C27.1 111.9 23.9 112.9 21.2 114.4C18.5 115.9 16.5 118.1 15.4 121C14.2 123.9 13.9 127.2 14.3 131.1C14.8 134.9 15.6 138.7 16.7 142.3C17.8 146 19.2 149.4 20.9 152.6C22.5 155.9 24.9 159.1 28 162.3C31.1 165.5 33.8 167.6 36 168.8C38.3 169.9 40.7 170.8 43.4 171.6C46.1 172.3 49 172.7 52.1 172.6C55.3 172.6 58.8 172.2 62.5 171.5C66.3 170.7 70 169.6 73.7 168C77.4 166.5 80.8 164.7 83.8 162.6C86.9 160.5 89.5 158.3 91.6 156.1C93.8 153.9 95.9 151.3 97.9 148.2C100 145.2 101.1 143.1 101.4 142.1C101.7 141.1 101.8 140.6 101.8 140.6C102.3 138.5 103.6 136.8 105.4 135.7C106.2 135.1 107.2 134.8 108.2 134.6C109.2 134.4 110.3 134.5 111.3 134.7C112.3 135 113.2 135.4 114.1 136C114.9 136.6 115.6 137.4 116.2 138.2C116.7 139.1 117.1 140.1 117.2 141.1C117.4 142.1 117.4 143.2 117.1 144.2Z", "M270.4 97.1C270.4 97.1 271.3 96.2 273.2 94.5C275 92.8 277.2 90.2 279.7 86.6C282.1 83 283.8 79.8 284.8 77C285.8 74.2 286.8 70.9 287.6 67C288.5 63.2 289.1 59.5 289.3 55.8C289.6 52.2 289.4 48.7 288.8 45.5C288.2 42.3 286.9 39.3 285.1 36.5C283.3 33.7 281 31.1 278.2 28.8C275.4 26.5 272.5 24.6 269.4 23.1C266.3 21.6 263.4 20.4 260.5 19.6C257.7 18.8 254.7 18.1 251.6 17.7C248.6 17.2 245.4 16.9 242.1 16.8C238.9 16.7 235.7 16.8 232.7 17.2C229.7 17.5 225.8 18.5 221.1 20.1C216.4 21.7 212.6 23.4 209.6 25.1C206.7 26.8 204.3 28.6 202.4 30.5C200.5 32.4 199.8 34 200.3 35.3C200.8 36.6 201 37.2 201 37.2C201.4 39.2 201 41.1 199.9 42.7C198.9 44.4 197.2 45.5 195.3 45.9C193.5 46.4 191.5 46.1 189.8 45C188.2 44 186.9 42.4 186.5 40.6C186.5 40.6 186.5 38.5 186.6 34.5C186.6 30.4 187.6 27.3 189.4 25.1C191.3 23 193.4 21.1 195.7 19.6C198.1 18 201.1 16.4 204.9 14.8C208.7 13.2 213.3 11.7 218.9 10.3C224.4 8.8 228.9 8 232.4 7.7C235.8 7.4 239.4 7.3 243.1 7.4C246.8 7.5 250.3 7.9 253.8 8.5C257.2 9.1 260.6 10 263.9 11.1C267.2 12.2 270.6 13.6 274.3 15.5C278 17.3 281.6 19.7 285.1 22.7C288.7 25.6 291.6 29 294 32.8C296.3 36.6 298 40.5 298.9 44.6C299.8 48.6 300.2 52.8 300.2 57C300.1 61.2 299.7 65.5 299.1 69.9C298.4 74.3 297.6 78.4 296.5 82.2C295.5 86 294.2 89.1 292.7 91.6C291.2 94.1 288.7 97.3 285.1 101.2C281.4 105.1 279.6 107 279.6 107C278.3 108.2 276.5 108.8 274.8 108.7C273 108.6 271.3 107.9 270.1 106.6C268.9 105.3 268.2 103.5 268.3 101.8C268.3 100 269.1 98.3 270.4 97.1Z", "M184.5 39.9C184.5 39.9 184.5 38.8 184.4 36.7C184.3 34.5 183.7 32.1 182.5 29.3C181.4 26.5 178.4 23.4 173.4 20.2C168.3 17 163.1 14.7 157.7 13.4C152.2 12.1 146.5 11.2 140.4 10.8C134.3 10.4 128.6 10.6 123.3 11.2C118 11.8 113.1 12.9 108.8 14.3C104.4 15.7 100.7 17.4 97.7 19.2C94.7 21.1 92.3 23.1 90.5 25.3C88.7 27.4 87.4 29.7 86.4 32C85.5 34.3 84.6 37.3 83.8 40.8C83.1 44.4 82.8 47.4 82.9 49.8C83.1 52.3 83.8 52.1 84.9 49.3C86.1 46.6 86.6 45.2 86.7 45.2C87.2 44.3 87.9 43.6 88.7 43C89.5 42.5 90.4 42.1 91.3 41.8C92.3 41.6 93.3 41.6 94.3 41.8C95.2 41.9 96.2 42.3 97 42.8C97.8 43.3 98.6 44 99.1 44.8C99.7 45.6 100.1 46.5 100.3 47.5C100.6 48.4 100.6 49.4 100.4 50.4C100.3 51.4 99.9 52.3 99.4 53.1C99.4 53.1 98.6 54.2 97 56.4C95.4 58.6 92.7 60.6 88.9 62.6C85.1 64.6 81.7 65.4 78.7 64.9C75.7 64.5 73.5 63 72.3 60.5C71 57.9 70.4 55.2 70.5 52.3C70.5 49.3 71 46.3 71.9 43.1C72.9 39.9 74.5 35.6 77 30.3C79.4 25 81.9 21 84.4 18.3C87 15.6 90 13.1 93.7 10.8C97.3 8.5 101.6 6.5 106.5 4.8C111.5 3.1 116.9 1.9 122.8 1C128.8 .1 135.1-.2 141.8 0C148.5 .2 155.1 1 161.5 2.2C167.9 3.5 173.5 5.2 178.3 7.4C183.1 9.5 186.8 11.9 189.5 14.5C192.2 17.1 194.2 19.7 195.3 22.1C196.4 24.5 197.3 28 197.8 32.5C198.4 37 198.7 39.2 198.7 39.3C198.7 41.1 198 42.9 196.8 44.2C195.5 45.6 193.8 46.4 191.9 46.4C190.1 46.5 188.3 45.9 186.9 44.6C185.5 43.4 184.7 41.7 184.5 39.9ZM85.9 51.4C85.9 51.4 85.6 50.5 85.1 48.8C84.6 47 82.9 45.4 80 44.1C77.1 42.8 74.3 41.8 71.6 41.1C68.9 40.5 66.2 40.1 63.5 39.8C60.8 39.5 58.2 39.5 55.7 39.7C53.3 39.8 49.7 40.7 45.1 42.3C40.6 43.8 36.6 45.8 33.3 48.3C30 50.7 27.5 53.4 25.8 56.2C24.1 59 22.9 62.2 22.2 65.8C21.5 69.4 20.9 73.6 20.3 78.6C19.8 83.5 19.5 86 19.6 86.1C19.4 87.8 18.5 89.4 17.2 90.6C15.8 91.7 14.1 92.2 12.3 92.1C10.6 91.9 9 91.1 7.8 89.7C6.7 88.4 6.1 86.6 6.3 84.9C6.3 84.9 6.5 82.2 6.9 76.8C7.3 71.5 8.2 66.4 9.4 61.5C10.7 56.7 12 53.1 13.2 50.8C14.5 48.5 16 46.5 17.7 44.7C19.4 42.9 22.4 40.5 26.8 37.5C31.2 34.6 34.8 32.5 37.6 31.3C40.5 30.2 43.4 29.2 46.5 28.4C49.5 27.6 52.6 27.1 55.7 26.9C58.8 26.7 62 26.6 65.2 26.8C68.5 26.9 71.9 27.3 75.5 27.9C79.1 28.6 82.5 29.5 85.8 30.9C89 32.3 91.9 34.3 94.4 36.9C96.9 39.5 98.5 41.8 99.1 43.8C99.8 45.9 100.1 46.9 100.2 46.9C100.5 47.9 100.6 48.8 100.5 49.8C100.4 50.8 100.1 51.8 99.7 52.6C99.2 53.5 98.6 54.3 97.8 54.9C97.1 55.5 96.2 56 95.3 56.3C94.3 56.6 93.3 56.7 92.4 56.6C91.4 56.5 90.4 56.3 89.5 55.8C87.8 54.9 86.5 53.3 85.9 51.4Z"], +}; diff --git a/apps/docs/src/components/ui/aside/Aside.astro b/apps/docs/src/components/ui/aside/Aside.astro new file mode 100644 index 0000000..f5f1576 --- /dev/null +++ b/apps/docs/src/components/ui/aside/Aside.astro @@ -0,0 +1,96 @@ +--- +/** + * Aside — a note, tip, caution or danger callout. + * + * + * + * For a rich title, pass it as a slot: Uses env. + * Each type's colour comes from CSS keyed on `data-type`, so a site can add + * its own type with a rule and an icon. + */ +import Icon from "@cloudflare/nimbus-docs/components/Icon.astro"; +import { cn } from "@/lib/cn"; +import type { HTMLAttributes } from "astro/types"; + +interface Props extends HTMLAttributes<"aside"> { + // Uses `type` (not `variant`) to match the conventional