Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"exclude": [
"eslint.config.mjs",
"**/fixtures",
"packages/node-legacy/src/legacy-html/assets",
"packages/react/src/html/ui",
"**/*.d.ts",
"www/**",
Expand Down
7 changes: 7 additions & 0 deletions .changeset/remove-legacy-generators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@doc-kit/core': minor
'@doc-kit/cli': patch
'@node-core/doc-kit-legacy': major
---

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
4 changes: 0 additions & 4 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ jobs:
input: './node/doc/api/*.md'
compare: object-assertion

- target: legacy-html
input: './node/doc/api/*.md'
compare: file-size

- target: web
input: './node/doc/api/*.md'
compare: file-size
Expand Down
6 changes: 1 addition & 5 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,7 @@
}
},
{
"files": [
"packages/node-legacy/src/legacy-html/assets/*.js",
"packages/react/src/html/ui/**/*",
"e2e/**/*.spec.js"
],
"files": ["packages/react/src/html/ui/**/*", "e2e/**/*.spec.js"],
"globals": {
"AsyncDisposableStack": "readonly",
"DisposableStack": "readonly",
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ comparators](docs/contributing/comparators.md) — live under

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

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

> [!TIP]
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ Generate API docs
Options:
--config-file <path> Config file
-i, --input <patterns...> Input file patterns (glob)
-t, --target <generator...> Target generator(s): a built-in name
(json, json-all, json-simple, legacy-html,
legacy-html-all, man-page, legacy-json,
-t, --target <generator...> Target generator(s): a built-in name (json,
json-all, json-simple, man-page, legacy-json,
legacy-json-all, addon-verify, api-links,
orama-db, llms-txt, llms-txt-full, sitemap,
html, section-pages) or an import specifier
Expand All @@ -93,11 +92,10 @@ Options:

### Legacy

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.
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.

```sh
npx @doc-kit/cli generate \
-t legacy-html \
-t legacy-json \
-i "path/to/node/doc/api/*.md" \
-o out \
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/comparators.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ scripts/

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

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

Expand Down
10 changes: 4 additions & 6 deletions docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ npx @doc-kit/cli generate -t html -t orama-db -t sitemap -i "docs/**/*.md" -o ou
1:1 matches for Node.js's original documentation tooling, for consumers of
the classic layouts.

| Target | Output |
| ---------------------------------------------------- | ----------------------------------- |
| [`legacy-html`](./generators/legacy-html.md) | One classic HTML page per document. |
| [`legacy-html-all`](./generators/legacy-html-all.md) | The single-page `all.html` bundle. |
| [`legacy-json`](./generators/legacy-json.md) | The classic per-document JSON. |
| [`legacy-json-all`](./generators/legacy-json-all.md) | The single-file JSON bundle. |
| Target | Output |
| ---------------------------------------------------- | ------------------------------ |
| [`legacy-json`](./generators/legacy-json.md) | The classic per-document JSON. |
| [`legacy-json-all`](./generators/legacy-json-all.md) | The single-file JSON bundle. |

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

Expand Down
4 changes: 1 addition & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ static server will do the trick; for example:
npx serve out -p 3000
```

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

## Customize the `html` generator output

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on [the OpenJS Slack][].

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

- <https://nodejs.org/api> - `legacy-html`, `legacy-json`
- <https://nodejs.org/api> - `html`, `section-pages`, `legacy-json`
- <https://nodejs.org/llms.txt> - `llms-txt`
- <https://beta.docs.nodejs.org/> - `html`, `orama-db`, `llms-txt`
- <https://nodejs.org/learn> - `html`, `orama-db`, `llms-txt`
Expand Down
10 changes: 5 additions & 5 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Output formats are provided by generators. This package ships the shared
pipeline stages and the JSON generators (`json`, `json-all`, and the
debugging-only `json-simple`); the rest come from companion packages:

| Package | Generators |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [`@doc-kit/generator-react`](https://www.npmjs.com/package/@doc-kit/generator-react) | `html` (the modern site), `orama-db`, `llms-txt`, `llms-txt-full`, `sitemap` |
| [`@node-core/doc-kit-legacy`](https://www.npmjs.com/package/@node-core/doc-kit-legacy) | `legacy-html`, `legacy-html-all`, `legacy-json`, `legacy-json-all` (Node.js-specific) |
| [`@node-core/doc-kit`](https://www.npmjs.com/package/@node-core/doc-kit) | `man-page`, `api-links`, `addon-verify` (Node.js-specific) |
| Package | Generators |
| -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [`@doc-kit/generator-react`](https://www.npmjs.com/package/@doc-kit/generator-react) | `html` (the modern site), `orama-db`, `llms-txt`, `llms-txt-full`, `sitemap` |
| [`@node-core/doc-kit-legacy`](https://www.npmjs.com/package/@node-core/doc-kit-legacy) | `legacy-json`, `legacy-json-all` (Node.js-specific) |
| [`@node-core/doc-kit`](https://www.npmjs.com/package/@node-core/doc-kit) | `man-page`, `api-links`, `addon-verify` (Node.js-specific) |

Custom generators load by import specifier — any module whose default export
is a generator works as a `--target`.
Expand Down
2 changes: 0 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"./json-simple": "./src/generators/json-simple/index.mjs",
"./metadata": "./src/generators/metadata/index.mjs",
"./package.json": "./package.json",
"./shiki.config.mjs": "./shiki.config.mjs",
"./src/*": "./src/*",
"./*": [
"./src/*",
Expand All @@ -46,7 +45,6 @@
"src",
"!src/**/*.test.mjs",
"!src/**/__tests__",
"shiki.config.mjs",
"CHANGELOG.md",
"LICENSE",
"README.md"
Expand Down
50 changes: 0 additions & 50 deletions packages/core/shiki.config.mjs

This file was deleted.

2 changes: 0 additions & 2 deletions packages/core/src/generators/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export const publicGenerators = {
json: '@doc-kit/core/json',
'json-all': '@doc-kit/core/json-all',
'json-simple': '@doc-kit/core/json-simple',
'legacy-html': '@node-core/doc-kit-legacy/legacy-html',
'legacy-html-all': '@node-core/doc-kit-legacy/legacy-html-all',
'man-page': '@node-core/doc-kit/man-page',
'legacy-json': '@node-core/doc-kit-legacy/legacy-json',
'legacy-json-all': '@node-core/doc-kit-legacy/legacy-json-all',
Expand Down
18 changes: 8 additions & 10 deletions packages/node-legacy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Node.js legacy-format generators for
[doc-kit](https://github.com/nodejs/doc-kit): 1:1 matches for the output of
Node.js's [original documentation
tooling](https://github.com/nodejs/node/tree/main/tools/doc), for consumers
that depend on the classic HTML and JSON layouts.
that depend on the classic JSON layouts.

## Install

Expand All @@ -14,20 +14,18 @@ npm install --save-dev @doc-kit/core @node-core/doc-kit-legacy

## Generators

| Target | Output |
| ----------------- | ------------------------------------------------------------ |
| `legacy-html` | One classic HTML page per input document. |
| `legacy-html-all` | The single-page `all.html` bundling every document together. |
| `legacy-json` | The classic per-document JSON, as published on nodejs.org. |
| `legacy-json-all` | The single-file JSON bundling every document together. |
| Target | Output |
| ----------------- | ---------------------------------------------------------- |
| `legacy-json` | The classic per-document JSON, as published on nodejs.org. |
| `legacy-json-all` | The single-file JSON bundling every document together. |

## Usage

```sh
npx @doc-kit/cli generate -t legacy-html -t legacy-json -i "doc/api/*.md" -o out
npx @doc-kit/cli generate -t legacy-json -i "doc/api/*.md" -o out
```

Unless you have consumers of these exact formats, prefer the modern
[`html` generator](https://doc-kit.nodejs.org/generators/html) from
`@doc-kit/generator-react`. See the
[`json` generator](https://doc-kit.nodejs.org/generators/json) from
`@doc-kit/core`. See the
[doc-kit documentation](https://doc-kit.nodejs.org) for details.
10 changes: 2 additions & 8 deletions packages/node-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
"name": "@node-core/doc-kit-legacy",
"type": "module",
"version": "1.0.4",
"description": "Node.js legacy-format generators for @doc-kit/core: legacy-html, legacy-html-all, legacy-json, and legacy-json-all",
"description": "Node.js legacy-format generators for @doc-kit/core: legacy-json and legacy-json-all",
"repository": {
"type": "git",
"url": "git+https://github.com/nodejs/doc-kit.git",
"directory": "packages/node-legacy"
},
"license": "MIT",
"exports": {
"./legacy-html": "./src/legacy-html/index.mjs",
"./legacy-html-all": "./src/legacy-html-all/index.mjs",
"./legacy-json": "./src/legacy-json/index.mjs",
"./legacy-json-all": "./src/legacy-json-all/index.mjs",
"./package.json": "./package.json"
Expand All @@ -26,11 +24,7 @@
],
"dependencies": {
"@doc-kit/core": "workspace:*",
"hastscript": "^9.0.1",
"rehype-stringify": "^10.0.1",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.2",
"unist-builder": "^4.0.0",
"unist-util-visit": "^5.1.0"
"remark-rehype": "^11.1.2"
}
}
13 changes: 0 additions & 13 deletions packages/node-legacy/src/legacy-html-all/README.md

This file was deleted.

73 changes: 0 additions & 73 deletions packages/node-legacy/src/legacy-html-all/generate.mjs

This file was deleted.

Loading
Loading