Repository navigation
Conversation
Rewrites every page, package README and generator README for clarity and accuracy against the code, and splits the docs into guides, which teach a task with one running example, and reference pages, which list every option. Guides link to the reference instead of repeating it. - `index.md` becomes `introduction.md`, and a new guide covers documenting TypeScript and JSDoc with `@doc-kit/typedoc`. - Every generator page follows one layout: what it makes, what it reads and writes, usage, options, then details. - The specification gains a reading guide, a table of its constructs and examples for every directive, and resolves rules it stated as both MUST and SHOULD. - Code examples whose Markdown bullets the formatter rewrote (the changelog, `index.md` and `llms.txt` samples) are plain text again, so they show what doc-kit actually reads and writes. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Gives doc-kit's own site a theme of its own, built entirely through the html generator's public extension points (theme slots, components, stylesheets, a template and rehype plugins), so the site doubles as an example of customizing doc-kit. - A home page that shows what doc-kit does: an isometric hero, the sources and outputs of one kittens module, the worker pool building a site, benchmarks and a getting-started path. Its canvases are islands that respect reduced motion. - A neutral palette over `@node-core/ui-components`, with light and dark themes, a cat logo, Inter, and styled search and theme menus. - Five isometric illustrations in the guides, inlined as SVG so they follow the color scheme, each on the one page it explains. - The sidebar groups guides, reference, generators and packages; the build script also takes the site's own pages from `www/pages`, and leaves out the legacy-format generators and the generators documented on another generator's page. Redirects send their old URLs to the sections that now cover them. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Islands that hydrate on interaction, such as code tabs and copy buttons, start loading their component on pointerover, focusin or touchstart. The click or tap that follows lands before the component exists, so it did nothing and had to be repeated. The runtime now holds an interaction island's presses until it is hydrated, then dispatches them again, each once the innermost island around it is ready. The site's redesign surfaced this on every code block. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1192 +/- ##
==========================================
- Coverage 93.41% 93.41% -0.01%
==========================================
Files 278 278
Lines 27840 27841 +1
Branches 2790 2790
==========================================
Hits 26008 26008
- Misses 1810 1811 +1
Partials 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| File | Main | PR | Change |
|---|---|---|---|
orama-db.json |
29.22 MB | 29.21 MB | -2.28 KB (-0.0%) |
Performance estimate (single CI run)
- Generation time: 44.7% slower (6.64 s → 9.61 s)
- Peak memory: 2.0% higher (1.26 GB → 1.28 GB)
web Generator
Output size: 62 files changed · net +442.00 B
File size details
| File | Main | PR | Change |
|---|---|---|---|
assets/SearchBox-CWh3xKwr.js |
84.66 KB | — | -84.66 KB (-100.0%) |
assets/SearchBox-BdHX3vut.js |
— | 84.66 KB | +84.66 KB |
assets/dist-BYff4Nb9.js |
30.42 KB | — | -30.42 KB (-100.0%) |
assets/dist-C7eu-QMF.js |
— | 30.42 KB | +30.42 KB |
assets/SideBar-C7dco05x.js |
25.61 KB | — | -25.61 KB (-100.0%) |
assets/SideBar-BFKhLZiT.js |
— | 25.61 KB | +25.61 KB |
assets/client-BQQWzemQ.js |
— | 25.51 KB | +25.51 KB |
assets/client-GPyj1vjp.js |
25.08 KB | — | -25.08 KB (-100.0%) |
assets/Combination-BmJ0lnzd.js |
16.11 KB | — | -16.11 KB (-100.0%) |
assets/Combination-Cisswayz.js |
— | 16.11 KB | +16.11 KB |
assets/ThemeToggle-Bws341Om.js |
13.65 KB | — | -13.65 KB (-100.0%) |
assets/ThemeToggle-C1UQEauZ.js |
— | 13.65 KB | +13.65 KB |
assets/dist-CtYeyKbs.js |
10.20 KB | — | -10.20 KB (-100.0%) |
assets/dist-s2dJyzCY.js |
— | 10.20 KB | +10.20 KB |
assets/compat-BdCbJT8e.js |
10.13 KB | — | -10.13 KB (-100.0%) |
assets/compat-DJI4HP2W.js |
— | 10.13 KB | +10.13 KB |
assets/Layout-6nbr2xwo.js |
10.13 KB | — | -10.13 KB (-100.0%) |
assets/Layout-BBAgbB5O.js |
— | 10.13 KB | +10.13 KB |
assets/Tooltip-CZdLypHU.js |
7.93 KB | — | -7.93 KB (-100.0%) |
assets/Tooltip-CJHkmzv8.js |
— | 7.93 KB | +7.93 KB |
assets/dist-BT83R5Zi.js |
6.99 KB | — | -6.99 KB (-100.0%) |
assets/dist-BLHiNdX4.js |
— | 6.99 KB | +6.99 KB |
assets/jsx-runtime-CcH8sYa0.js |
5.67 KB | — | -5.67 KB (-100.0%) |
assets/jsx-runtime-CFD_AiNP.js |
— | 5.67 KB | +5.67 KB |
assets/dist-BnS9dFnb.js |
3.93 KB | — | -3.93 KB (-100.0%) |
assets/dist-NruYoZhJ.js |
— | 3.93 KB | +3.93 KB |
assets/CodeTabs-B-vr1rJG.js |
3.89 KB | — | -3.89 KB (-100.0%) |
assets/CodeTabs-BEfbyepZ.js |
— | 3.89 KB | +3.89 KB |
assets/CodeBox-CZUrdd_C.js |
3.44 KB | — | -3.44 KB (-100.0%) |
assets/CodeBox-CmcEZJRY.js |
— | 3.44 KB | +3.44 KB |
assets/hooks.module-JC599V3k.js |
3.40 KB | — | -3.40 KB (-100.0%) |
assets/hooks.module-B18TDaSJ.js |
— | 3.40 KB | +3.40 KB |
assets/FunctionSignature-CCIPZNzz.js |
2.28 KB | — | -2.28 KB (-100.0%) |
assets/FunctionSignature-CqU7SA59.js |
— | 2.28 KB | +2.28 KB |
assets/Banner-BT1yBYM5.js |
2.13 KB | — | -2.13 KB (-100.0%) |
assets/Banner-CERJf3OS.js |
— | 2.13 KB | +2.13 KB |
assets/ChangeHistory-BGC8GXW-.js |
1.77 KB | — | -1.77 KB (-100.0%) |
assets/ChangeHistory-BBDLArJi.js |
— | 1.77 KB | +1.77 KB |
assets/DataTag-BAJRxOON.js |
844.00 B | — | -844.00 B (-100.0%) |
assets/DataTag-CiNGJsvR.js |
— | 844.00 B | +844.00 B |
assets/DocumentationIndex-D9u01mMO.js |
833.00 B | — | -833.00 B (-100.0%) |
assets/DocumentationIndex-CL7cXzP1.js |
— | 833.00 B | +833.00 B |
assets/ArrowUpRightIcon-3rrAw9tL.js |
618.00 B | — | -618.00 B (-100.0%) |
assets/ArrowUpRightIcon-BlEG4PZL.js |
— | 618.00 B | +618.00 B |
assets/Badge-DCiAoYW0.js |
607.00 B | — | -607.00 B (-100.0%) |
assets/Badge-3Km-dvLx.js |
— | 607.00 B | +607.00 B |
assets/AlertBox-BjJkptee.js |
591.00 B | — | -591.00 B (-100.0%) |
assets/AlertBox-Bg2dNr5c.js |
— | 591.00 B | +591.00 B |
assets/CodeBracketIcon-CLozeGPo.js |
512.00 B | — | -512.00 B (-100.0%) |
assets/CodeBracketIcon-CQ_4oTxF.js |
— | 512.00 B | +512.00 B |
assets/dist-Qgd4IXja.js |
477.00 B | — | -477.00 B (-100.0%) |
assets/dist-DJvZWtTq.js |
— | 477.00 B | +477.00 B |
assets/ChevronDownIcon-CeCixlbl.js |
468.00 B | — | -468.00 B (-100.0%) |
assets/ChevronDownIcon-DaaOx4YA.js |
— | 468.00 B | +468.00 B |
assets/renderLabel-De9VfGuc.js |
447.00 B | — | -447.00 B (-100.0%) |
assets/renderLabel-Bs9nCkC4.js |
— | 447.00 B | +447.00 B |
assets/Blockquote-DYd-xjeH.js |
167.00 B | — | -167.00 B (-100.0%) |
assets/Blockquote-CC0xAiqY.js |
— | 167.00 B | +167.00 B |
assets/useRemoteConfig-C1tgkHqf.js |
151.00 B | — | -151.00 B (-100.0%) |
assets/useRemoteConfig-s4vrPRWw.js |
— | 151.00 B | +151.00 B |
assets/withIsland-Zt0EKufw.js |
105.00 B | — | -105.00 B (-100.0%) |
assets/withIsland-42qYoA_E.js |
— | 105.00 B | +105.00 B |
Performance estimate (single CI run)
- Generation time: 25.6% faster (23.70 s → 17.63 s)
- Peak memory: 2.4% higher (1.95 GB → 1.99 GB)
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
…diagrams The diagram parser removed the XML declaration and comments with one regex replace before tokenizing, which CodeQL flags as incomplete multi-character sanitization: a crafted input could re-form `<!--` after the replace. Each one already arrives as its own token, so the parser now skips those tokens instead. The inlined diagrams are byte-for-byte the same. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
cc @nodejs/web-admins The preview URL is https://27dcb7e5-doc-kit.nodejs.workers.dev, any idea why it's not showing there? |
Weird... No idea... @dario-piotrowicz any idea? |
avivkeller
left a comment
There was a problem hiding this comment.
Initial round of reviews... I didn't read all files, but this is a start
| The `doc-kit` command-line interface. Every option that maps to | ||
| configuration can also live in a [configuration file](./configuration.md); | ||
| when both are present, CLI flags win (rule of specifity). | ||
| The `doc-kit` command builds your docs with `doc-kit generate` and serves |
There was a problem hiding this comment.
doc-kit preview doesn't exist yet, fwiw
There was a problem hiding this comment.
Yup, I know :) I think this PR will likely land after #1082, so I'd rather keep the preview docs here than add them back later.
There was a problem hiding this comment.
We should include the script to generate this, since I imagine we may want to change it's content in the future
There was a problem hiding this comment.
Done: www/og/og.html is the card and node --run og (from www/) renders it into www/public/og.png.
There was a problem hiding this comment.
Do we need these benchmarks? How accurate are they?
There was a problem hiding this comment.
They're medians of clean builds on my machine (five runs each). I added www/benchmark.mjs (node --run benchmark in www/), which builds this site and a Node.js release's API docs and writes benchmarks.json for the home page, so anyone can reproduce or refresh them. I'll run it again once #1179 and #1180 land.
Moves `PRESS_EVENTS` into `ui/constants.mjs`, and says why only a held click is prevented: preventing a pointerdown would also suppress the mouse events that follow it, which are held too, and preventing a mousedown would stop focus and text selection. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
The site's dependencies (Inter, Preact and the html generator its theme builds on) move from the root package.json into a private `@doc-kit/www` package, so the root only holds the repo's own tooling again. Preact still resolves to the one copy the html generator uses. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
`www/og/og.html` is the card behind `www/public/og.png`, and `node --run og` renders it again with Playwright, in the site's own fonts, so the image can change with the site. It reproduces the current image pixel for pixel. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
The home page and the introduction quote build times that were measured by hand. `node --run benchmark` in `www/` now measures them: it builds this site and a Node.js release's API docs, each target on its own and all of them in one run, from a clean output every time, and writes the medians, the page and word counts, the JavaScript the home page loads up front, the machine and the commit to `www/theme/benchmarks.json`, which `data.mjs` reads. The numbers are re-measured with it: five runs each, for this site's 40 pages and the Node.js v26.12.1 API docs. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
The site builds every generator's page again, rather than folding json-all, json-simple and llms-txt-full into their parent pages and leaving the legacy-format package out. Their READMEs get their content back, in the layout every generator page shares, and the legacy package's pages are rewritten to match, checked against its code. The overview lists them all, while the sidebar keeps to the main generators. The page globs also merge into one, and the redirects for these pages are gone, as they exist again. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
The home page's words and code samples now live in `www/pages/index.mdx` instead of a JSX component, so they're edited like any other page. Its code samples are fenced blocks, highlighted by doc-kit and shown in its own code boxes and tabs, with their copy buttons, which replaces the theme's own highlighter, copy button, code box, install tabs and output tabs. What MDX can't express stays in thin components: the two canvas animations, the sections' layout, and the hand-drawn previews and card art. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
avivkeller
left a comment
There was a problem hiding this comment.
There's still a decent way to go, I see a lot of things that your AI likely just decided to change but make this diff a lot more than it needs to be.
Also, we need to discuss the marketing aspect of this, i.e. this adds a tagline, mascot, logo, and a whole lot of things we haven't properly discussed.
There was a problem hiding this comment.
Let's put some more thought into these animations, e.g. making sure there are finalized and clean before we ship them (so no overflowing arrows, etc
| URLs documenting them, used to link types (`metadata.typeMap`). | ||
| - `--minify` {boolean} Minify the output (`global.minify`). **Default:** | ||
| `false`. | ||
| - `-p`, `--threads` {number} Worker threads to use, at least 1 (`threads`). |
There was a problem hiding this comment.
Does our typed list system support ,?
| built-in generators is the target name. Every generator's reference page | ||
| lists its options: | ||
|
|
||
| | Section | Its own options | Reference | |
There was a problem hiding this comment.
I don't like listing all these sections here, we list them again in their respective READMEs, why duplicate that?
| @@ -1,592 +1,564 @@ | |||
| # Creating Generators | |||
| # Creating generators | |||
There was a problem hiding this comment.
Are we sentence casing everywhere?
| import getConfig from '@doc-kit/core/utils/configuration/index.mjs'; | ||
| import { writeFile } from '@doc-kit/core/utils/file.mjs'; | ||
|
|
||
| /** |
There was a problem hiding this comment.
A lot of these JSDocs were helpful to explain the various keys
| # Sections come from `www/theme/home/sections.jsx`, which reads their numbers | ||
| # from `www/theme/data.mjs`. The outputs are excerpts, with `…` marking what's | ||
| # cut. Notes go here, as MDX comments would reach llms-full.txt and the JSON. |
There was a problem hiding this comment.
| # Sections come from `www/theme/home/sections.jsx`, which reads their numbers | |
| # from `www/theme/data.mjs`. The outputs are excerpts, with `…` marking what's | |
| # cut. Notes go here, as MDX comments would reach llms-full.txt and the JSON. |
AI slop comment
| <Hero | ||
| badge="Building the next Node.js API docs" | ||
| badgeLink="https://beta.docs.nodejs.org/" | ||
| title="The docs toolkit" |
There was a problem hiding this comment.
We haven't decided on a tagline, we should think one up
| --- | ||
|
|
||
| <Hero | ||
| badge="Building the next Node.js API docs" |
There was a problem hiding this comment.
| badge="Building the next Node.js API docs" | |
| badge="Building the next generation of Node.js API docs" |
There was a problem hiding this comment.
What's this file for, it seems like it generates another file? Can't we design an animation in Figma and export it like that?
There was a problem hiding this comment.
-1 on styles for SVGs, SVGs should inline their own styles
| - `-t`, `--target` {string[]} Generators to run (`target`): built-in names, | ||
| such as `html` or `orama-db` (see the [generators overview](./generators.md)), | ||
| or the import specifier or path of a | ||
| [custom generator](./creating-generators.md). Only `json`, `json-all`, and |
There was a problem hiding this comment.
This package to generator mapping also lives in generators.md, the cli README and the core README. Can we just link to generators.md?
| configuration key, and wins over the file. `--config-file` picks the file | ||
| itself, and has no key. | ||
|
|
||
| | Flag | Configuration key | |
There was a problem hiding this comment.
cli.md already puts the config key next to every flag, so this table repeats it. Let's keep one and link to it.
|  | ||
|
|
||
| ### Web ([`@doc-kit/generator-react`](./packages/react.md)) | ||
| Each generator has a reference page laid out the same way: what it makes, how |
There was a problem hiding this comment.
Filler, the reader can see the layout. Drop it?
|
|
||
| ## Options | ||
|
|
||
| Each generator reads its options from the configuration section named after it, |
There was a problem hiding this comment.
This repeats configuration.md#generator-options, and "flags replace the list" is now said in three places (here, cli.md, configuration.md). Link instead?
| @@ -0,0 +1,138 @@ | |||
| # Why doc-kit | |||
|
|
|||
| doc-kit is a documentation toolkit for APIs. It reads your API from Markdown, | |||
There was a problem hiding this comment.
doc-kit itself doesn't read TypeScript or JSDoc, the (experimental) typedoc plugin turns them into Markdown first.
| <Button href="/introduction">Why doc-kit?</Button> | ||
| </Actions> | ||
|
|
||
| ```bash displayName="npm" |
There was a problem hiding this comment.
The install tabs show up twice on this page (here and in "Install" below). Let's keep one.
| const parse = markup => { | ||
| const root = { type: 'root', children: [] }; | ||
| const stack = [root]; | ||
| const tokens = markup.split(/(<[^>]+>)/); |
There was a problem hiding this comment.
What is this meant to do, does doc-kit not support something about the SVGs?
| @@ -0,0 +1,700 @@ | |||
| // Where the pipeline animation puts everything: the scene's geometry, the | |||
There was a problem hiding this comment.
Between HeroFlow, PipelineFlow, canvas.mjs and pipeline/* this is ~2,700 lines of bespoke isometric canvas engine for two animations. That's a lot for us to maintain 😅. Can we cut it down, or use exported assets?
| @@ -0,0 +1,278 @@ | |||
| // Measures the builds the home page quotes, and writes them to | |||
There was a problem hiding this comment.
We already have scripts/comparators/performance.mjs. Can this reuse it (or live in scripts/) instead of being a second, separate benchmark harness?
| const { tag, dir } = await nodeCheckout(); | ||
| const api = join(dir, 'doc', 'api'); | ||
|
|
||
| // quic.md is left out, as Node.js's own build does |
There was a problem hiding this comment.
Hardcoding Node's quic.md exclusion is fragile, it'll go stale when Node changes its Makefile and QUIC stablizes. Can we read it from beta/'s config, or leave it out?
Description
This PR redesigns doc-kit.nodejs.org: a new theme and home page, illustrations for the guides, and a rewrite of the documentation itself. The whole site is built through doc-kit's own extension points (theme slots, components, stylesheets, a custom template and a rehype plugin), so it doubles as an example of how far you can take customizing doc-kit.
Site
kittensmodule, the worker pool building a site, benchmarks and a getting-started path. It's written in MDX (www/pages/index.mdx), and its code samples are plain fenced blocks, so they get doc-kit's own highlighting, code boxes, tabs and copy buttons. Only the two canvases, the sections' layout and a few hand-drawn previews are components.@node-core/ui-components, with light and dark modes, a cat logo, Inter, and styled search and theme menus.wwwis its own private workspace package now (@doc-kit/www), so the site's dependencies stay out of the rootpackage.json. It also holds the source of the social preview image (node --run ogrenderswww/og/og.html) and the benchmark the home page quotes (node --run benchmark, which writeswww/theme/benchmarks.json). The current numbers: this site's 40 pages build in 2.94 s, and the Node.js v26.12.1 API docs in 10.77 s.Documentation
index.mdbecameintroduction.md, and there's a new guide for documenting TypeScript and JSDoc with@doc-kit/typedoc.json-all,json-simple,llms-txt-fulland the four legacy ones. The overview links all of them, and the sidebar keeps to the main ones. The specification got a reading guide, a table of its constructs and an example for each directive.Package change
The only published change is a patch to
@doc-kit/generator-react. Islands that hydrate on interaction (code tabs, copy buttons) used to swallow the click or tap that started their hydration, so you had to press twice. The runtime now holds those presses and replays them once the island is ready, covered bypresses.test.mjs.Follow-ups
Stability: Nin a code example gets linked), sidebar reveal, backticks in page titles, search on nested 404s, navbaractiveOnand search labels.doc-kit previewis documented already, pending feat: addpreviewcommand #1082.llms-full.txtandindex.jsonas raw MDX, and doc-kit hides the copy button on one-line code blocks, so the install commands don't get one. Both need small fixes in the generators.all.htmlmiss a slash,legacy-html-allandlegacy-json-allcan change order between runs, and--git-refdoesn't reachlegacy-html.Validation
node --run format:check,node --run lintandnode --run test(753 tests) pass, and a production build of the site (41 pages) has no broken links or missing assets.The home page:
The whole home page, dark, light and on a phone
The docs, in both themes, on a phone and with search open:
The illustrations, each on the page it explains (Getting started, Writing documentation, Customizing the site, Creating generators and Generators):
Related Issues
None.
Check List
node --run testand all tests passed.node --run format:check&node --run lint.