Skip to content

Commit 309dea2

Browse files
committed
chore: remove the legacy-html and legacy-html-all generators
Node.js builds its API docs with the redesigned `html` generator since nodejs/node#62045, so nothing uses the legacy HTML generators anymore. This also removes what only they used: the `shiki.config.mjs` export of `@doc-kit/core`, and the `hastscript`, `remark-parse`, `unist-builder`, and `unist-util-visit` dependencies of `@node-core/doc-kit-legacy`. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent de88b03 commit 309dea2

40 files changed

Lines changed: 35 additions & 2903 deletions

‎.c8rc.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"exclude": [
44
"eslint.config.mjs",
55
"**/fixtures",
6-
"packages/node-legacy/src/legacy-html/assets",
76
"packages/react/src/html/ui",
87
"**/*.d.ts",
98
"www/**",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@doc-kit/core': major
3+
'@doc-kit/cli': major
4+
'@node-core/doc-kit-legacy': major
5+
---
6+
7+
Remove the `legacy-html` and `legacy-html-all` generators, now that Node.js builds its API docs with the redesigned `html` generator. The `shiki.config.mjs` export of `@doc-kit/core`, which only they used, is removed too

‎.github/workflows/generate.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ jobs:
102102
input: './node/doc/api/*.md'
103103
compare: object-assertion
104104

105-
- target: legacy-html
106-
input: './node/doc/api/*.md'
107-
compare: file-size
108-
109105
- target: web
110106
input: './node/doc/api/*.md'
111107
compare: file-size

‎.oxlintrc.json‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,7 @@
204204
}
205205
},
206206
{
207-
"files": [
208-
"packages/node-legacy/src/legacy-html/assets/*.js",
209-
"packages/react/src/html/ui/**/*",
210-
"e2e/**/*.spec.js"
211-
],
207+
"files": ["packages/react/src/html/ui/**/*", "e2e/**/*.spec.js"],
212208
"globals": {
213209
"AsyncDisposableStack": "readonly",
214210
"DisposableStack": "readonly",

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ comparators](docs/contributing/comparators.md) — live under
116116

117117
```bash
118118
node packages/cli/bin/cli.mjs generate \
119-
-t legacy-html \
119+
-t html \
120120
-i ../node/doc/api/fs.md \
121121
-o out \
122122
--index ../node/doc/api/index.md \
@@ -136,7 +136,7 @@ comparators](docs/contributing/comparators.md) — live under
136136
Add `--log-level debug` before the `generate` subcommand to see the full pipeline trace:
137137

138138
```bash
139-
node packages/cli/bin/cli.mjs --log-level debug generate -t legacy-html -i ../node/doc/api/fs.md -o out
139+
node packages/cli/bin/cli.mjs --log-level debug generate -t html -i ../node/doc/api/fs.md -o out
140140
```
141141

142142
> [!TIP]

‎README.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ Generate API docs
6868
Options:
6969
--config-file <path> Config file
7070
-i, --input <patterns...> Input file patterns (glob)
71-
-t, --target <generator...> Target generator(s): a built-in name
72-
(json, json-all, json-simple, legacy-html,
73-
legacy-html-all, man-page, legacy-json,
71+
-t, --target <generator...> Target generator(s): a built-in name (json,
72+
json-all, json-simple, man-page, legacy-json,
7473
legacy-json-all, addon-verify, api-links,
7574
orama-db, llms-txt, llms-txt-full, sitemap,
7675
html, section-pages) or an import specifier
@@ -93,11 +92,10 @@ Options:
9392

9493
### Legacy
9594

96-
To generate a 1:1 match with the [legacy tooling](https://github.com/nodejs/node/tree/main/tools/doc), use the `legacy-html`, `legacy-json`, `legacy-html-all`, and `legacy-json-all` generators.
95+
To generate a 1:1 match with the JSON of the [legacy tooling](https://github.com/nodejs/node/tree/main/tools/doc), use the `legacy-json` and `legacy-json-all` generators.
9796

9897
```sh
9998
npx @doc-kit/cli generate \
100-
-t legacy-html \
10199
-t legacy-json \
102100
-i "path/to/node/doc/api/*.md" \
103101
-o out \

‎docs/contributing/comparators.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ scripts/
3939

4040
Comparators can be reused across multiple generators. You specify which comparator to use in the workflow file using the `compare` field. For example:
4141

42-
- `file-size.mjs` can compare output from `html`, `legacy-html`, or any generator
42+
- `file-size.mjs` can compare output from `html`, `orama-db`, or any generator
4343
- `object-assertion.mjs` can compare JSON output from `legacy-json`, `json-simple`, etc.
4444
- `my-comparator.mjs` would be a custom comparator for specific needs
4545

‎docs/generators.md‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ npx @doc-kit/cli generate -t html -t orama-db -t sitemap -i "docs/**/*.md" -o ou
3232
1:1 matches for Node.js's original documentation tooling, for consumers of
3333
the classic layouts.
3434

35-
| Target | Output |
36-
| ---------------------------------------------------- | ----------------------------------- |
37-
| [`legacy-html`](./generators/legacy-html.md) | One classic HTML page per document. |
38-
| [`legacy-html-all`](./generators/legacy-html-all.md) | The single-page `all.html` bundle. |
39-
| [`legacy-json`](./generators/legacy-json.md) | The classic per-document JSON. |
40-
| [`legacy-json-all`](./generators/legacy-json-all.md) | The single-file JSON bundle. |
35+
| Target | Output |
36+
| ---------------------------------------------------- | ------------------------------ |
37+
| [`legacy-json`](./generators/legacy-json.md) | The classic per-document JSON. |
38+
| [`legacy-json-all`](./generators/legacy-json-all.md) | The single-file JSON bundle. |
4139

4240
### Node.js-specific ([`@node-core/doc-kit`](./packages/node.md))
4341

‎docs/getting-started.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ static server will do the trick; for example:
5050
npx serve out -p 3000
5151
```
5252

53-
Then open the printed URL (usually <http://localhost:3000>). The
54-
`legacy-html-all` output from earlier has no such requirement — `out/all.html`
55-
opens straight from disk.
53+
Then open the printed URL (usually <http://localhost:3000>).
5654

5755
## Customize the `html` generator output
5856

‎docs/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on [the OpenJS Slack][].
88

99
A few places `doc-kit` is already in use. Feel free to PR yours.
1010

11-
- <https://nodejs.org/api> - `legacy-html`, `legacy-json`
11+
- <https://nodejs.org/api> - `html`, `section-pages`, `legacy-json`
1212
- <https://nodejs.org/llms.txt> - `llms-txt`
1313
- <https://beta.docs.nodejs.org/> - `html`, `orama-db`, `llms-txt`
1414
- <https://nodejs.org/learn> - `html`, `orama-db`, `llms-txt`

0 commit comments

Comments
 (0)