{"$schema":"https://doc-kit.nodejs.org/schemas/api-doc/1.0.1.json","id":"packages-node","path":"/packages/node","type":"module","module":"packages-node","title":"`@node-core/doc-kit`","introducedIn":null,"sourceLink":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"The Node.js-specific parts of [doc-kit](https://doc-kit.nodejs.org): three\ngenerators for outputs only the Node.js project needs (its man page,\n`apilinks.json` and its addon example tests), and `@node-core/doc-kit/config`,\na preset that configures the general-purpose generators the way nodejs.org builds its\nAPI documentation.\n\nUse it to build the Node.js API documentation, or documentation shaped like\nit. Other projects don't need it: doc-kit's defaults are project-neutral, so\nstart from [Getting started](https://doc-kit.nodejs.org/getting-started).","summary":"The Node.js-specific parts of doc-kit: three generators for outputs only the Node.js project needs (its man page, `apilinks.json` and its addon example tests), and `@node-core/doc-kit/config`, a preset that configures the general-purpose generators the way nodejs.org builds its API documentation.","examples":[],"children":[{"kind":"section","id":"install","name":"Install","title":"Install","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"```sh\nnpm install --save-dev @doc-kit/cli @node-core/doc-kit\n```\n\nThat covers the three generators. To build the website, the search index,\n`llms.txt` or the sitemap with the preset, also install the generators that\nmake them:\n\n```sh\nnpm install --save-dev @doc-kit/generator-react\n```","summary":"That covers the three generators. To build the website, the search index, `llms.txt` or the sitemap with the preset, also install the generators that make them:","examples":[{"language":"sh","displayName":null,"code":"npm install --save-dev @doc-kit/cli @node-core/doc-kit"},{"language":"sh","displayName":null,"code":"npm install --save-dev @doc-kit/generator-react"}],"children":[]},{"kind":"section","id":"generators","name":"Generators","title":"Generators","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"The CLI loads each target name from this package: `man-page` loads\n`@node-core/doc-kit/man-page`.\n\n| Target                                                               | Input in Node.js    | Output                                                                                                               |\n| -------------------------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| [`man-page`](https://doc-kit.nodejs.org/generators/man-page)         | `doc/api/cli.md`    | `node.1`, the `node` man page in mdoc format, with the options and environment variables that `cli.md` documents     |\n| [`api-links`](https://doc-kit.nodejs.org/generators/api-links)       | `lib/*.js`          | `apilinks.json`, which maps each API (such as `buffer.Buffer`) to the line on GitHub that defines it                 |\n| [`addon-verify`](https://doc-kit.nodejs.org/generators/addon-verify) | `doc/api/addons.md` | A folder per addon example (such as `02_function_arguments/`), with its C++ and JavaScript files and a `binding.gyp` |\n\nFrom the root of a Node.js checkout:\n\n```sh\nnpx doc-kit generate -t man-page -i doc/api/cli.md -o out\nnpx doc-kit generate -t api-links -i \"lib/*.js\" -o out\nnpx doc-kit generate -t addon-verify -i doc/api/addons.md -o out/addons\n```\n\n> \\[!IMPORTANT]\n> `api-links` builds its URLs from the `repository` and `ref` options. doc-kit\n> sets no repository by default, so without one the URLs keep a literal\n> `{repository}`. Extend the [preset](#the-nodejs-preset), which sets\n> `nodejs/node`, or set `global.repository` in your configuration. Pass\n> `--git-ref` to link to a tag or commit instead of `HEAD`.","summary":"The CLI loads each target name from this package: `man-page` loads `@node-core/doc-kit/man-page`.","examples":[{"language":"sh","displayName":null,"code":"npx doc-kit generate -t man-page -i doc/api/cli.md -o out\nnpx doc-kit generate -t api-links -i \"lib/*.js\" -o out\nnpx doc-kit generate -t addon-verify -i doc/api/addons.md -o out/addons"}],"children":[]},{"kind":"section","id":"the-nodejs-preset","name":"The Node.js preset","title":"The Node.js preset","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"`@node-core/doc-kit/config` gives the project-neutral generators Node.js\nbranding, URL layouts and release history. Extend it from your configuration\nfile:\n\n```mjs displayName=\"doc-kit.config.mjs\"\nexport default {\n  extends: '@node-core/doc-kit/config',\n\n  target: ['html', 'orama-db'],\n  global: {\n    input: ['doc/api/*.md'],\n    output: 'out',\n  },\n};\n```\n\nThe preset doesn't choose targets or inputs. It sets these options:\n\n| Option                                      | Value                                                                                      |\n| ------------------------------------------- | ------------------------------------------------------------------------------------------ |\n| `global.project`                            | `Node.js`                                                                                  |\n| `global.repository`, `global.ref`           | `nodejs/node`, `HEAD`                                                                      |\n| `global.baseURL`                            | `https://nodejs.org/docs`                                                                  |\n| `global.changelog`                          | `https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md`, the release history     |\n| `html.editURL`                              | `https://github.com/{repository}/edit/{ref}/doc/api{path}.md`                              |\n| `html.pageURL`                              | `{baseURL}/latest-{version}/api{path}.html`                                                |\n| `html.remoteConfigUrl`                      | `https://nodejs.org/site.json`, which the browser fetches for banners and the release list |\n| `html.head`                                 | The Node.js description, Open Graph tags and favicon                                       |\n| `html.stylesheets`                          | A theme with the Node.js green brand colors                                                |\n| `html.imports`                              | The Node.js logo as `#theme/Logo`                                                          |\n| `llms-txt.templatePath`, `llms-txt.pageURL` | A Node.js llms.txt header, and `{baseURL}/latest/api{path}.md`                             |\n| `sitemap.indexURL`, `sitemap.pageURL`       | `{baseURL}/latest/api/`, `{baseURL}/latest/api{path}.html`                                 |\n\nSee [Website](https://doc-kit.nodejs.org/generators/html),\n[llms.txt](https://doc-kit.nodejs.org/generators/llms-txt) and\n[Sitemap](https://doc-kit.nodejs.org/generators/sitemap) for what each option\ndoes.\n\n> \\[!TIP]\n> With the preset, every run downloads the release history from GitHub. To\n> build offline, pass a local copy instead, such as `--changelog CHANGELOG.md`\n> from the root of a Node.js checkout.","summary":"`@node-core/doc-kit/config` gives the project-neutral generators Node.js branding, URL layouts and release history. Extend it from your configuration file:","examples":[{"language":"mjs","displayName":"doc-kit.config.mjs","code":"export default {\n  extends: '@node-core/doc-kit/config',\n\n  target: ['html', 'orama-db'],\n  global: {\n    input: ['doc/api/*.md'],\n    output: 'out',\n  },\n};"}],"children":[{"kind":"section","id":"overriding-the-preset","name":"Overriding the preset","title":"Overriding the preset","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"Your configuration file wins over the preset. Objects merge key by key, but an\narray you set (such as `html.stylesheets` or `html.head.meta`) replaces the\npreset's instead of adding to it (see\n[Precedence](https://doc-kit.nodejs.org/configuration#precedence)). To keep the\nNode.js theme and add a stylesheet of your own, spread the preset's value:\n\n```mjs displayName=\"doc-kit.config.mjs\"\nimport { join } from 'node:path';\n\nimport preset from '@node-core/doc-kit/config';\n\nexport default {\n  extends: '@node-core/doc-kit/config',\n\n  html: {\n    stylesheets: [\n      ...preset.html.stylesheets,\n      join(import.meta.dirname, 'extra.css'),\n    ],\n  },\n};\n```","summary":"Your configuration file wins over the preset. Objects merge key by key, but an array you set (such as `html.stylesheets` or `html.head.meta`) replaces the preset's instead of adding to it (see Precedence). To keep the Node.js theme and add a stylesheet of your own, spread the preset's value:","examples":[{"language":"mjs","displayName":"doc-kit.config.mjs","code":"import { join } from 'node:path';\n\nimport preset from '@node-core/doc-kit/config';\n\nexport default {\n  extends: '@node-core/doc-kit/config',\n\n  html: {\n    stylesheets: [\n      ...preset.html.stylesheets,\n      join(import.meta.dirname, 'extra.css'),\n    ],\n  },\n};"}],"children":[]}]},{"kind":"section","id":"learn-more","name":"Learn more","title":"Learn more","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"* [Configuration](https://doc-kit.nodejs.org/configuration): configuration\n  files, `extends`, and how options merge.\n* [CLI](https://doc-kit.nodejs.org/cli): every `doc-kit generate` option.\n* [Customizing the site](https://doc-kit.nodejs.org/customization): colors,\n  logo, head tags and theme slots, to change what the preset sets.\n* [Man page](https://doc-kit.nodejs.org/generators/man-page),\n  [API links](https://doc-kit.nodejs.org/generators/api-links) and\n  [Addon examples](https://doc-kit.nodejs.org/generators/addon-verify): the\n  options of each generator in this package.","summary":"","examples":[],"children":[]}]}