https://github.com/nodejs/doc-kit
Node.js's tooling for API generation
https://github.com/nodejs/doc-kit
ast hast mdast node unified wip
Last synced: 9 months ago
JSON representation
Node.js's tooling for API generation
- Host: GitHub
- URL: https://github.com/nodejs/doc-kit
- Owner: nodejs
- License: mit
- Created: 2024-05-11T20:16:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T15:53:21.000Z (over 1 year ago)
- Last Synced: 2025-02-02T00:26:40.585Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://nodejs.org/api
- Size: 483 KB
- Stars: 4
- Watchers: 35
- Forks: 6
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
@nodejs/doc-kit is a tool to generate API documentation of Node.js. See this issue for more information.
## Usage
Local invocation:
```sh
$ npx doc-kit --help
```
```sh
$ node bin/cli.mjs --help
```
```
Usage: @nodejs/doc-kit [options] [command]
CLI tool to generate the Node.js API documentation
Options:
-h, --help display help for command
Commands:
generate [options] Generate API docs
interactive Launch guided CLI wizard
help [command] display help for command
```
### `generate`
```
Usage: @nodejs/doc-kit generate [options]
Generate API docs
Options:
-i, --input Input file patterns (glob)
--ignore [patterns...] Ignore patterns (comma-separated)
-o, --output Output directory
-p, --threads (default: "12")
-v, --version Target Node.js version (default: "v22.14.0")
-c, --changelog Changelog URL or path (default: "https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md")
--git-ref Git ref/commit URL (default: "https://github.com/nodejs/node/tree/HEAD")
-t, --target [modes...] Target generator modes (choices: "json-simple", "legacy-html", "legacy-html-all", "man-page", "legacy-json", "legacy-json-all", "addon-verify", "api-links", "orama-db", "llms-txt")
-h, --help display help for command
```
### `interactive`
```
Usage: @nodejs/doc-kit interactive [options]
Launch guided CLI wizard
Options:
-h, --help display help for command
```
## Examples
### 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.
```sh
npx doc-kit generate \
-t legacy-html \
-t legacy-json \
-i "path/to/node/doc/api/*.md" \
-o out \
--index path/to/node/doc/api/index.md
```
### Redesigned
To generate [our redesigned documentation pages](https://nodejs-api-docs-tooling.vercel.app), use the `web` and `orama-db` (for search) generators.
```sh
npx doc-kit generate \
-t web \
-t orama-db \
-i "path/to/node/doc/api/*.md" \
-o out \
--index path/to/node/doc/api/index.md
```
> [!TIP]
> In order to use the search functionality, you _must_ serve the output directory.
>
> ```sh
> npx serve out
> ```