{
  "type": "module",
  "source": "doc/api/configuration.md",
  "modules": [
    {
      "textRaw": "Configuration",
      "name": "configuration",
      "type": "module",
      "desc": "<p><code>doc-kit</code> uses <a href=\"https://github.com/cosmiconfig/cosmiconfig\"><code>cosmiconfig</code></a> to\ndiscover and load configuration. Run the CLI from your project directory and it\nwill automatically look for a <code>doc-kit</code> property in <code>package.json</code>, rc files\nsuch as <code>.doc-kitrc.yml</code>, and module files such as <code>doc-kit.config.mjs</code>.</p>\n<p>Use <code>--config-file &#x3C;path></code> to load a specific file instead of searching.</p>",
      "modules": [
        {
          "textRaw": "Configuration File Format",
          "name": "configuration_file_format",
          "type": "module",
          "desc": "<p>Configuration files can be either:</p>\n<ul>\n<li><strong>JavaScript</strong> (<code>.js</code>, <code>.mjs</code>, <code>.cjs</code>)</li>\n<li><strong>TypeScript</strong> (<code>.ts</code>, loaded through Node.js type stripping, so only erasable syntax such as type annotations works)</li>\n<li><strong>JSON</strong> (<code>.json</code>)</li>\n<li><strong>YAML</strong> (<code>.yaml</code>, <code>.yml</code>, or an extensionless rc file)</li>\n</ul>\n<p>JavaScript and TypeScript configuration files export the configuration object.\nJSON and YAML files contain the object directly. A <code>package.json</code> configuration\nuses the <code>doc-kit</code> property:</p>\n<pre><code class=\"language-json\">{\n  \"doc-kit\": {\n    \"target\": [\"json-simple\"],\n    \"global\": {\n      \"input\": \"doc/api/*.md\",\n      \"output\": \"out\"\n    }\n  }\n}\n</code></pre>",
          "modules": [
            {
              "textRaw": "Basic Example",
              "name": "basic_example",
              "type": "module",
              "desc": "<pre><code class=\"language-mjs\">export default {\n  // Targets, alternatively supplied by command line flags. Each entry is\n  // either a built-in shorthand name or an import specifier resolving to a\n  // generator module (e.g. '@my-scope/my-package/my-generator').\n  target: ['orama-db', 'html'],\n  global: {\n    project: 'My Project',\n    version: '1.2.0',\n    input: 'docs/**/*.md',\n    output: 'dist/',\n    ignore: ['node_modules/', 'test/'],\n    baseURL: 'https://example.com/docs/',\n  },\n\n  threads: 4,\n  chunkSize: 10,\n\n  // Generator-specific configurations\n  html: {\n    title: '{project} Documentation',\n  },\n\n  metadata: {\n    typeMap: {\n      MyThing: 'https://example.com/docs/my-thing.html',\n    },\n  },\n};\n</code></pre>",
              "displayName": "Basic Example"
            }
          ],
          "displayName": "Configuration File Format"
        },
        {
          "textRaw": "Extending Presets",
          "name": "extending_presets",
          "type": "module",
          "desc": "<p>A configuration file may declare <code>extends</code>: one or more presets whose values\nare merged underneath its own. Each entry is either an import specifier of a\nmodule whose default export is a configuration object, or a path relative to\nthe configuration file:</p>\n<pre><code class=\"language-mjs\">export default {\n  // Build the docs the way nodejs.org does — branding, URL layouts,\n  // and release history included\n  extends: '@node-core/doc-kit/config',\n\n  html: {\n    // Your own values still win over the preset\n    title: '{project} {version} API Reference',\n  },\n};\n</code></pre>\n<p><code>extends</code> also accepts an array; later presets take precedence over earlier\nones, and the configuration file itself wins over all of them.</p>\n<p>The built-in defaults are deliberately project-neutral: no repository,\nsite URL, release history, or branding is assumed. The\n<a href=\"https://github.com/nodejs/doc-kit/tree/main/packages/node\"><code>@node-core/doc-kit/config</code></a>\npreset opts back into everything Node.js-specific.</p>",
          "displayName": "Extending Presets"
        },
        {
          "textRaw": "Configuration Structure",
          "name": "configuration_structure",
          "type": "module",
          "desc": "<p>Three sources, in order of precedence:</p>\n<ol>\n<li><strong>CLI flags</strong> (see the <a href=\"./cli.html\">CLI reference</a>) override</li>\n<li><strong>the configuration file</strong>, which overrides</li>\n<li><strong>built-in defaults</strong>.</li>\n</ol>",
          "displayName": "Configuration Structure"
        },
        {
          "textRaw": "Global options",
          "name": "global_options",
          "type": "module",
          "desc": "<p>Everything under the <code>global</code> key applies to every generator:</p>\n<ul>\n<li><code>project</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a></code> Name of the project being documented, used in titles,\nlogos, and templated text. Defaults to the <code>name</code> in your <code>package.json</code>.</li>\n<li><code>version</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a> | SemVer</code> Documentation version. <strong>Default:</strong>\n<code>process.version</code>.</li>\n<li><code>minify</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#boolean_type\" class=\"type-link\">boolean</a></code> Whether to minify output. <strong>Default:</strong> <code>false</code>.</li>\n<li><code>repository</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a></code> GitHub repository in <code>owner/repo</code> format; without\none, repository UI is omitted.</li>\n<li><code>ref</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a></code> Git reference (branch, tag, or commit SHA). <strong>Default:</strong>\n<code>'HEAD'</code>.</li>\n<li><code>baseURL</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a> | <a href=\"https://developer.mozilla.org/docs/Web/API/URL\" class=\"type-link\">URL</a></code> Base URL of the published site, used wherever\nabsolute URLs are needed.</li>\n<li><code>input</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a>[]</code> Input file patterns (glob).</li>\n<li><code>output</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a></code> Output directory path.</li>\n<li><code>ignore</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a>[]</code> Patterns to ignore. <strong>Default:</strong> <code>[]</code>.</li>\n<li><code>changelog</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a> | <a href=\"https://developer.mozilla.org/docs/Web/API/URL\" class=\"type-link\">URL</a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Release history used for version selectors;\na URL or path to parse, or a pre-parsed array. <strong>Default:</strong> <code>[]</code>\n(single-version output).</li>\n<li><code>index</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a> | <a href=\"https://developer.mozilla.org/docs/Web/API/URL\" class=\"type-link\">URL</a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Index URL.</li>\n<li><code>markdown</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> <a href=\"#markdown-plugins\">Markdown plugins</a> for every\ngenerator processing Markdown.</li>\n</ul>\n<p>A generator's own section (e.g., <code>html</code>, <code>legacy-json</code>) can override any of\nthese for that generator alone, except <code>markdown</code>, which it adds to.</p>",
          "displayName": "Global options"
        },
        {
          "textRaw": "Execution options",
          "name": "execution_options",
          "type": "module",
          "desc": "<p>Top-level, alongside <code>target</code> and <code>global</code>:</p>\n<ul>\n<li><code>threads</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\" class=\"type-link\">number</a></code> Worker threads used for generation. Defaults to your\nCPU count. Each worker's heap is limited to 512MB; to raise the limit, run\nNode.js with <code>--max-old-space-size</code> (directly or through <code>NODE_OPTIONS</code>).</li>\n<li><code>chunkSize</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#number_type\" class=\"type-link\">number</a></code> Items processed per worker thread. <strong>Default:</strong> <code>10</code>.</li>\n<li><code>discardResults</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#boolean_type\" class=\"type-link\">boolean</a></code> Keeps none of the requested generators' results,\nso each can be let go as soon as it is produced. <code>doc-kit generate</code> and\n<code>doc-kit preview</code> set it. <strong>Default:</strong> <code>false</code>.</li>\n</ul>",
          "displayName": "Execution options"
        },
        {
          "textRaw": "Generator options",
          "name": "generator_options",
          "type": "module",
          "desc": "<p>Each generator documents its own options on its reference page — see the\n<a href=\"./generators.html\">generators overview</a>. Two commonly configured ones:</p>\n<pre><code class=\"language-mjs\">export default {\n  global: {\n    version: '1.2.0',\n    minify: true,\n  },\n\n  metadata: {\n    typeMap: {\n      MyThing: 'https://example.com/docs/my-thing.html',\n    },\n  },\n};\n</code></pre>",
          "displayName": "Generator options"
        },
        {
          "textRaw": "Markdown plugins",
          "name": "markdown_plugins",
          "type": "module",
          "desc": "<p><code>doc-kit</code> processes Markdown with <a href=\"https://unifiedjs.com/\">unified</a>.\n<code>global.markdown</code> adds plugins to every generator processing Markdown, and a\ngenerator's own <code>markdown</code> adds plugins to it alone, after the global ones.</p>\n<pre><code class=\"language-mjs\">export default {\n  global: {\n    markdown: {\n      remarkPlugins: ['remark-math'],\n    },\n  },\n\n  // The generator rendering the site's pages\n  'jsx-ast': {\n    markdown: {\n      rehypePlugins: [\n        'rehype-katex',\n        ['./plugins/rehype-diagrams.mjs', { theme: 'neutral' }],\n      ],\n    },\n  },\n};\n</code></pre>\n<p>Each plugin is a module specifier (a package name, or a path relative to the\nconfiguration file), alone or in a <code>[specifier, options]</code> pair. The module\ndefault-exports the plugin, a list of plugins, or a unified preset. Markdown is\nprocessed in worker threads, which import the plugins themselves, so options\nmust be serializable: configure a plugin taking functions in a module of your\nown.</p>\n<ul>\n<li><code>remarkPlugins</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> The global ones run on each document once the <code>ast</code>\ngenerator parses it, so every output sees their changes. A generator\nrendering Markdown, such as <code>jsx-ast</code>, runs its own on what it renders.</li>\n<li><code>rehypePlugins</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Run on the HTML of the generators rendering\nMarkdown, such as <code>jsx-ast</code>, before code is highlighted.</li>\n<li><code>recmaPlugins</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Run on the JavaScript <code>jsx-ast</code> compiles the pages to.</li>\n</ul>\n<p>A generator only takes the plugins its pipeline has a place for: <code>jsx-ast</code>\ntakes all three kinds, <code>ast</code>, <code>metadata</code>, and <code>json</code> take remark plugins, and\ngenerators such as <code>html</code> take none. Plugins listed for a generator that\ndoesn't take them are ignored with a warning.</p>\n<p>A generator runs each plugin once: listing one it already has, its own or a\nglobal one, configures it instead, merging the options (arrays add up, and\nobjects merge).</p>\n<p>The plugins configured for <code>jsx-ast</code> don't apply to the fragments it renders\non their own: types, parameter descriptions, and change history notes.</p>",
          "modules": [
            {
              "textRaw": "Code highlighting",
              "name": "code_highlighting",
              "type": "module",
              "desc": "<p><code>jsx-ast</code> highlights code with the <code>@doc-kit/core/plugins/shiki/rehype.mjs</code>\nplugin, which runs <a href=\"https://shiki.style/\">Shiki</a> with every language it\nbundles. To configure it, list it with options in\n<code>jsx-ast.markdown.rehypePlugins</code> (with pnpm, add <code>@doc-kit/core</code> to your\ndependencies, so your configuration file can resolve it):</p>\n<ul>\n<li><code>langs</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> More languages: grammars, or modules default-exporting them.</li>\n<li><code>langAlias</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Aliases of languages, such as <code>{ conf: 'ini' }</code>.</li>\n<li><code>themes</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> The <code>light</code> and <code>dark</code> themes: names of themes Shiki\nbundles, modules default-exporting themes, or themes.</li>\n<li><code>transformers</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Modules default-exporting\n<a href=\"https://shiki.style/guide/transformers\">Shiki transformers</a>, or lists of\nthem.</li>\n</ul>\n<p>These modules are paths relative to the working directory, or URLs, such as\nthe ones <code>import.meta.resolve()</code> gives:</p>\n<pre><code class=\"language-mjs\">export default {\n  'jsx-ast': {\n    markdown: {\n      rehypePlugins: [\n        [\n          '@doc-kit/core/plugins/shiki/rehype.mjs',\n          {\n            langAlias: { conf: 'ini' },\n            themes: { light: 'github-light', dark: 'github-dark' },\n            transformers: [import.meta.resolve('./shiki-transformers.mjs')],\n          },\n        ],\n      ],\n    },\n  },\n};\n</code></pre>",
              "displayName": "Code highlighting"
            }
          ],
          "displayName": "Markdown plugins"
        },
        {
          "textRaw": "Configuration Merging",
          "name": "configuration_merging",
          "type": "module",
          "desc": "<p>Configurations are merged in the following order (higher sources take\nprecedence):</p>\n<ol>\n<li><strong>CLI options</strong> (command-line arguments)</li>\n<li><strong>Configuration file</strong> (discovered or selected with <code>--config-file</code>)</li>\n<li><strong>Presets</strong> (listed in the configuration file's <code>extends</code>)</li>\n<li><strong>Default values</strong> (built-in defaults)</li>\n</ol>",
          "displayName": "Configuration Merging"
        },
        {
          "textRaw": "CLI Options Mapping",
          "name": "cli_options_mapping",
          "type": "module",
          "desc": "<p>CLI options map to configuration properties:</p>\n<table>\n<thead>\n<tr>\n<th>CLI Option</th>\n<th>Config Property</th>\n<th>Example</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>--input &#x3C;path></code></td>\n<td><code>global.input</code></td>\n<td><code>--input src/</code></td>\n</tr>\n<tr>\n<td><code>--output &#x3C;path></code></td>\n<td><code>global.output</code></td>\n<td><code>--output dist/</code></td>\n</tr>\n<tr>\n<td><code>--ignore &#x3C;pattern></code></td>\n<td><code>global.ignore[]</code></td>\n<td><code>--ignore test/</code></td>\n</tr>\n<tr>\n<td><code>--minify</code></td>\n<td><code>global.minify</code></td>\n<td><code>--minify</code></td>\n</tr>\n<tr>\n<td><code>--git-ref &#x3C;ref></code></td>\n<td><code>global.ref</code></td>\n<td><code>--git-ref v20.0.0</code></td>\n</tr>\n<tr>\n<td><code>--version &#x3C;version></code></td>\n<td><code>global.version</code></td>\n<td><code>--version 20.0.0</code></td>\n</tr>\n<tr>\n<td><code>--changelog &#x3C;url></code></td>\n<td><code>global.changelog</code></td>\n<td><code>--changelog https://...</code></td>\n</tr>\n<tr>\n<td><code>--index &#x3C;url></code></td>\n<td><code>global.index</code></td>\n<td><code>--index file://...</code></td>\n</tr>\n<tr>\n<td><code>--type-map &#x3C;map></code></td>\n<td><code>metadata.typeMap</code></td>\n<td><code>--type-map file://...</code></td>\n</tr>\n<tr>\n<td><code>--target &#x3C;generator></code></td>\n<td><code>target</code></td>\n<td><code>--target json</code></td>\n</tr>\n<tr>\n<td><code>--threads &#x3C;n></code></td>\n<td><code>threads</code></td>\n<td><code>--threads 4</code></td>\n</tr>\n<tr>\n<td><code>--chunk-size &#x3C;n></code></td>\n<td><code>chunkSize</code></td>\n<td><code>--chunk-size 10</code></td>\n</tr>\n</tbody>\n</table>",
          "displayName": "CLI Options Mapping"
        }
      ],
      "displayName": "Configuration"
    }
  ]
}