Skip to content

Commit 8436900

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 in `@doc-kit/core`: the `shiki.config.mjs` and `utils/remark-shiki.mjs` exports, the default export of `utils/highlighter.mjs`, and the `hastscript` and `shiki` dependencies. Assisted-by: Claude Opus 5.5 <[email protected]>
1 parent 8df4659 commit 8436900

42 files changed

Lines changed: 37 additions & 2950 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.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 `@doc-kit/core` exports only they used are removed too: `shiki.config.mjs`, `utils/remark-shiki.mjs`, and the default export of `utils/highlighter.mjs`

‎.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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@
204204
}
205205
},
206206
{
207-
"files": [
208-
"packages/node-legacy/src/legacy-html/assets/*.js",
209-
"packages/react/src/html/ui/**/*"
210-
],
207+
"files": ["packages/react/src/html/ui/**/*"],
211208
"globals": {
212209
"AsyncDisposableStack": "readonly",
213210
"DisposableStack": "readonly",

‎CONTRIBUTING.md‎

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

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

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

141141
> [!TIP]

‎README.md‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ 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,
75-
orama-db, llms-txt, sitemap, html,
76-
section-pages) or an import specifier for a
77-
custom generator
74+
orama-db, llms-txt, sitemap, html, section-pages)
75+
or an import specifier for a custom generator
7876
--ignore <patterns...> Ignore file patterns (glob)
7977
-o, --output <directory> The output directory
8078
-p, --threads <number> Number of threads to use (minimum: 1)
@@ -93,11 +91,10 @@ Options:
9391

9492
### Legacy
9593

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.
94+
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.
9795

9896
```sh
9997
npx @doc-kit/cli generate \
100-
-t legacy-html \
10198
-t legacy-json \
10299
-i "path/to/node/doc/api/*.md" \
103100
-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
@@ -31,12 +31,10 @@ npx @doc-kit/cli generate -t html -t orama-db -t sitemap -i "docs/**/*.md" -o ou
3131
1:1 matches for Node.js's original documentation tooling, for consumers of
3232
the classic layouts.
3333

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

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

‎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)