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
| "devDependencies": { | ||
| "@changesets/changelog-github": "^1.0.0", | ||
| "@changesets/cli": "^3.0.3", | ||
| "@doc-kit/generator-react": "workspace:*", |
There was a problem hiding this comment.
Should www be it's own workspace package?
There was a problem hiding this comment.
Good call, done: www is now a private @doc-kit/www workspace package with the site's own deps, so the root package.json is back to what's on main.
| 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.
| export const PRESS_EVENTS = [ | ||
| 'pointerdown', | ||
| 'mousedown', | ||
| 'pointerup', | ||
| 'mouseup', | ||
| 'click', | ||
| 'pointercancel', | ||
| ]; |
There was a problem hiding this comment.
Moved it to ui/constants.mjs 👍
| if (event.type === 'click') { | ||
| event.preventDefault(); | ||
| } |
There was a problem hiding this comment.
Shouldn't we preventDefault() regardless of the event type?
There was a problem hiding this comment.
Only the click has a default action we need to hold (following a link, submitting a form). preventDefault() on the pointerdown would also suppress the mousedown/mouseup that follow it, which we're holding too, and on the mousedown it'd kill focus and text selection. Added a comment saying so.
| // Left out of the site: the legacy-format package, whose generators only | ||
| // exist for Node.js's classic layouts, and the generators documented on | ||
| // another generator's page. `www/public/_redirects` sends their old URLs on. | ||
| const EXCLUDE = [ | ||
| 'packages/node-legacy/**', | ||
| 'packages/*/src/{,generators/}{llms-txt-full,json-all,json-simple}/**', | ||
| ]; |
There was a problem hiding this comment.
These should still exist on the website, IMO we should list all generators, right?
There was a problem hiding this comment.
Fair! They're all built again now: every generator has its own page and the overview links all of them, the legacy ones included. I kept the sidebar to the main ones so it doesn't get too long, wdyt?
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.
Why do we have a custom copy button, doc-kit provides a copy-able code box
There was a problem hiding this comment.
Good point, the home page is MDX now and uses doc-kit's own code boxes and tabs, so these are gone. One catch: doc-kit hides the copy button on one-line code blocks, so the install commands don't get one. I think that'd be a nice fix upstream.
There was a problem hiding this comment.
Doesn't doc-kit provide this functionality?
There was a problem hiding this comment.
It does, so this is gone: the samples are fenced blocks now, highlighted by doc-kit.
There was a problem hiding this comment.
Gone, it's doc-kit's code tabs now.
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.
There was a problem hiding this comment.
Can we inline most of this to the MDX file?
There was a problem hiding this comment.
Yup, done: the words and code samples live in www/pages/index.mdx now, and what's left in JSX is the canvases, the sections' layout and the hand-drawn previews.
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>
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.