{
  "type": "module",
  "source": "doc/api/generators-html.md",
  "modules": [
    {
      "textRaw": "`html` Generator",
      "name": "`html`_generator",
      "type": "module",
      "desc": "<p>The <code>html</code> generator turns the pages' JSX into a complete static site: the\nserver-rendered HTML pages, the client-side JavaScript, CSS, and imported\nassets, written to <code>output</code>. Vite is the default bundler adapter, but projects\ncan supply an adapter for webpack or another bundler. The generator is\noutput-only and does not return an in-memory copy of its HTML or CSS.</p>\n<p>The site is built in pieces that are each as small as they can be. The bundler\nbuilds the component library once and the client assets once. Each page's\nprogram is then compiled — JSX to a plain module — and the worker pool imports,\nrenders, templates, minifies and writes the pages one at a time, so memory\nscales with the largest page rather than with the site. <code>all.html</code> is assembled\nfrom the module pages' compiled content rather than built again from scratch.</p>",
      "modules": [
        {
          "textRaw": "Configuring",
          "name": "configuring",
          "type": "module",
          "desc": "<ul>\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> The directory where HTML and bundled client output are\nwritten. Required.</li>\n<li><code>templatePath</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> Path to the HTML template file.\n<strong>Default:</strong> <code>'template.html'</code>.</li>\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> Project name used in page titles and the version selector.\n<strong>Default:</strong> inherited from <code>global.project</code>.</li>\n<li><code>title</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> Title template for HTML pages (supports <code>{project}</code>,\n<code>{version}</code>). <strong>Default:</strong> <code>'{project} v{version} Documentation'</code>.</li>\n<li><code>useAbsoluteURLs</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> When <code>true</code>, all internal links use absolute URLs\nbased on <code>baseURL</code>. <strong>Default:</strong> <code>false</code>.</li>\n<li><code>editURL</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> URL template for \"edit this page\" links.\n<strong>Default:</strong> none — the \"edit this page\" link is omitted.</li>\n<li><code>pageURL</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> URL template for documentation page links.\n<strong>Default:</strong> <code>'{baseURL}{path}.html'</code>.</li>\n<li><code>remoteConfigUrl</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> URL fetched client-side at runtime for remote site\nconfig (currently used to power the announcement banner).\n<strong>Default:</strong> none — no runtime fetch, no banner.</li>\n<li><code>head</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Configurable <code>&#x3C;meta></code>, <code>&#x3C;link></code>, and raw markup for the\ndocument head. See <a href=\"#head\"><code>head</code></a>.</li>\n<li><code>stylesheets</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Paths to extra stylesheets bundled after the built-in\none. See <a href=\"#stylesheets\"><code>stylesheets</code></a>. <strong>Default:</strong> <code>[]</code>.</li>\n<li><code>imports</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Object mapping <code>#theme/</code> aliases to component paths for\ncustomization. See <a href=\"#default-imports\">Default <code>imports</code></a>.</li>\n<li><code>virtualImports</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Additional virtual module mappings supplied to the\nserver and client builds. <strong>Default:</strong> <code>{}</code>.</li>\n<li><code>components</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Maps JSX tag names to component imports, enabling\nJSX-in-MDX. See <a href=\"#components\"><code>components</code></a>. <strong>Default:</strong> <code>{}</code>.</li>\n<li><code>navigation</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Sidebar groups and navigation bar items. See\n<a href=\"#navigation\"><code>navigation</code></a>. <strong>Default:</strong> <code>{}</code>.</li>\n<li><code>generateAllPage</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> When <code>true</code>, writes <code>all.html</code>: every module\npage's content on one page, in sidebar order, assembled from the module pages\nrather than built again. Chunk pages and the index are left out.\n<strong>Default:</strong> <code>true</code>.</li>\n<li><code>bundler</code> <code class=\"type\">WebBundler</code> Adapter that bundles the component library and the\nclient assets, and compiles page programs. See\n<a href=\"#bundler-adapters\">Bundler adapters</a>. <strong>Default:</strong> <code>createViteBundler()</code>.</li>\n</ul>",
          "modules": [
            {
              "textRaw": "`head`",
              "name": "`head`",
              "type": "module",
              "desc": "<ul>\n<li><code>meta</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> <code>&#x3C;meta></code> tags. Each entry is an attribute bag, e.g.\n<code>{ name: 'description', content: '…' }</code>.</li>\n<li><code>links</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> <code>&#x3C;link></code> tags. Each entry is an attribute bag, e.g.\n<code>{ rel: 'icon', href: '…' }</code>.</li>\n<li><code>html</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Raw HTML strings appended verbatim — an escape hatch for\nanything not expressible above.</li>\n</ul>\n<p>The <code>head</code> object controls the project-specific markup injected into the\ndocument <code>&#x3C;head></code> (rendered into the template's <code>${head}</code> placeholder).</p>\n<p>Each attribute bag is rendered as a tag: a boolean <code>true</code> becomes a valueless\nattribute (e.g. <code>crossorigin</code>), and <code>false</code>/<code>null</code>/<code>undefined</code> attributes are\nomitted. Using arrays of attribute bags (rather than <code>name → value</code> maps) means\nyou can emit repeated tags (e.g. two <code>preconnect</code> links) and pick the right\nattribute (<code>name</code> vs <code>property</code>) per tag.</p>\n<p>The default <code>head</code> is empty — brand the output by supplying your own tags:</p>\n<pre><code class=\"language-js\">// doc-kit.config.mjs\nexport default {\n  html: {\n    head: {\n      meta: [\n        { name: 'description', content: 'My project documentation' },\n        { property: 'og:image', content: 'https://example.com/og.png' },\n      ],\n      links: [\n        { rel: 'icon', href: 'https://example.com/favicon.ico' },\n        { rel: 'stylesheet', href: 'https://example.com/fonts.css' },\n      ],\n      html: ['&#x3C;meta name=\"theme-color\" content=\"#000\" />'],\n    },\n  },\n};\n</code></pre>\n<blockquote>\n<p>Structural and theme-bound tags are emitted by the template itself rather than\nvia <code>head</code>, including <code>og:title</code> (which mirrors the per-page title) and\n<code>og:type</code>. The UI stylesheet bundles its fonts locally.</p>\n</blockquote>",
              "displayName": "`head`"
            },
            {
              "textRaw": "`stylesheets`",
              "name": "`stylesheets`",
              "type": "module",
              "desc": "<p>Each entry is a path to a CSS file, bundled into the site's single stylesheet\nafter the built-in one — so its rules and custom properties win. Relative paths\nresolve against the working directory; prefer absolute paths (e.g.\n<code>join(import.meta.dirname, 'theme.css')</code>) when the config file can be loaded\nfrom elsewhere.</p>\n<p>The built-in accent palette is a project-neutral grey. Rebrand the output by\nredefining the nine <code>--color-brand-*</code> custom properties, which the UI components\nuse for links, focus rings, and active states:</p>\n<pre><code class=\"language-css\">/* theme.css */\n:root {\n  --color-brand-100: #edf2eb;\n  --color-brand-200: #c5e5b4;\n  --color-brand-300: #99cc7d;\n  --color-brand-400: #84ba64;\n  --color-brand-500: #5fa04e;\n  --color-brand-600: #417e38;\n  --color-brand-700: #2c682c;\n  --color-brand-800: #2c682c;\n  --color-brand-900: #1a3f1d;\n}\n</code></pre>\n<pre><code class=\"language-js\">// doc-kit.config.mjs\nimport { join } from 'node:path';\n\nexport default {\n  html: {\n    stylesheets: [join(import.meta.dirname, 'theme.css')],\n  },\n};\n</code></pre>",
              "displayName": "`stylesheets`"
            },
            {
              "textRaw": "`navigation`",
              "name": "`navigation`",
              "type": "module",
              "desc": "<ul>\n<li><code>sidebar</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Sidebar groups, each <code>{ groupName, items }</code>. Defaults to one\n<code>API Documentation</code> group holding every page.</li>\n<li><code>navbar</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Navigation bar items, each <code>{ text, link, target? }</code>.\nDefaults to none, which renders no items.</li>\n</ul>\n<p>The <code>navigation</code> object supplies the site's two navigation surfaces. Both keys\nare optional; omit either one to keep that component's default.</p>\n<p>Sidebar items are <code>{ label, link }</code> and may nest through an <code>items</code> array of\ntheir own. A <code>label</code> is plain text, except that backticked spans render as\n<code>&#x3C;code></code> (<code>'`fs`'</code>), matching how page headings are rendered. A <code>link</code> is a\npage path without its extension (<code>/fs</code>, <code>/generators/html</code>): it is resolved\nagainst the page being rendered, so it obeys <code>useAbsoluteURLs</code> and highlights\nwhile it is the current page. Links starting with <code>http://</code> or <code>https://</code> are\nused as authored.</p>\n<p>Navigation bar links are always used as authored, since they typically point\noutside the generated site. Give them a <code>target</code> of <code>'_blank'</code> to open in a new\ntab and mark them with an external-link icon.</p>\n<pre><code class=\"language-js\">// doc-kit.config.mjs\nexport default {\n  html: {\n    navigation: {\n      sidebar: [\n        {\n          groupName: 'Guides',\n          items: [{ label: 'Getting started', link: '/getting-started' }],\n        },\n        {\n          groupName: 'Reference',\n          items: [{ label: '`fs`', link: '/fs' }],\n        },\n      ],\n      navbar: [\n        { text: 'Learn', link: 'https://nodejs.org/en/learn' },\n        { text: 'Download', link: 'https://nodejs.org/en/download' },\n      ],\n    },\n  },\n};\n</code></pre>\n<p>The sidebar also renders a version <code>&#x3C;Select></code> built from <code>changelog</code>. A site\nconfigured without one has no versions to switch between, so the control is\nomitted rather than rendered empty.</p>",
              "displayName": "`navigation`"
            },
            {
              "textRaw": "Bundler adapters",
              "name": "bundler_adapters",
              "type": "module",
              "desc": "<ul>\n<li><code>buildServer</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type-link\">Function</a></code> Bundle the component library for Node and return\nthe <code>file:</code> URL of the built module.</li>\n<li><code>compile</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type-link\">Function</a></code> Turn one page program, a module using JSX, into plain\nJavaScript Node can import.</li>\n<li><code>buildClient</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type-link\">Function</a></code> Bundle the client <code>entry</code> into <code>config.output</code> and\nreturn the assets every page loads.</li>\n</ul>\n<p>The <code>bundler</code> option accepts a small Doc Kit adapter rather than configuration\nfor a particular build system.</p>\n<p><code>buildServer</code> receives <code>{ entry, virtualImports, outDir, config }</code>. The <code>entry</code>\nis the component library's source: re-exports of every component a page may\nrender, Preact's <code>h</code> and <code>Fragment</code>, and <code>renderToStringAsync</code>. It must be\nbundled into one self-contained module written under <code>outDir</code> (a temporary\ndirectory the generator removes afterwards), since the page programs import it\nfrom wherever they are compiled to.</p>\n<p><code>compile(code, fileName)</code> receives one page program: a module that imports the\nlibrary and exports the page's <code>content</code> and a default function rendering the\npage from its layout props, written in JSX. It must return plain JavaScript. The JSX must compile with the classic\nruntime to calls of the <code>_jsx</code> and <code>_Fragment</code> bindings the program imports\n(these names are exported as <code>JSX_PRAGMA</code> and <code>JSX_PRAGMA_FRAG</code> from the\ngenerator's <code>constants.mjs</code>), so that the page and the library share one Preact.</p>\n<p><code>buildClient</code> receives <code>{ entry, virtualImports, config }</code>. The client <code>entry</code>\nis a single program shared by every page. It must be bundled into\n<code>config.output</code> and the call must return\n<code>{ scripts, preloads, stylesheets }</code>: paths relative to the output root of the\nmodule scripts to load, the chunks they statically import (rendered as\n<code>modulepreload</code> hints), and the stylesheets. The generator renders those into\nevery page, resolved against the page's location.</p>\n<p><code>config</code> is the resolved <code>html</code> configuration. The adapter must compile the\ngenerated Preact JSX and CSS imports and resolve the supplied theme aliases and\nvirtual modules. The generated <code>#theme/config</code> module exports <code>server</code> as\n<code>true</code> for the server build and <code>false</code> for the client build.</p>\n<p>A webpack integration can live entirely in project configuration without\nadding webpack to Doc Kit:</p>\n<pre><code class=\"language-js\">// webpack-bundler.mjs\nexport const createWebpackBundler = webpackOptions => ({\n  async buildServer({ entry, virtualImports, outDir, config }) {\n    // Materialize or load the in-memory modules, run webpack's Node target\n    // with the entry, write one self-contained module under `outDir`, and\n    // return its `file:` URL.\n  },\n\n  async compile(code, fileName) {\n    // Transform the page's JSX (classic runtime, pragma `_jsx`, fragment\n    // pragma `_Fragment`) and return the resulting module source.\n  },\n\n  async buildClient({ entry, virtualImports, config }) {\n    // Run webpack's browser target into config.output and return\n    // { scripts, preloads, stylesheets } as output-relative paths.\n  },\n});\n</code></pre>\n<pre><code class=\"language-js\">// doc-kit.config.mjs\nimport { createWebpackBundler } from './webpack-bundler.mjs';\n\nexport default {\n  html: {\n    bundler: createWebpackBundler({\n      // Project-owned webpack configuration.\n    }),\n  },\n};\n</code></pre>",
              "displayName": "Bundler adapters"
            },
            {
              "textRaw": "Vite adapter",
              "name": "vite_adapter",
              "type": "module",
              "desc": "<p>When <code>bundler</code> is omitted, the generator imports and uses\n<code>createViteBundler()</code> automatically. To customize Vite, import the adapter\ndirectly and pass Vite's <code>UserConfig</code> to it:</p>\n<pre><code class=\"language-js\">// doc-kit.config.mjs\nimport { createViteBundler } from '@doc-kit/generator-react/html/bundlers/vite';\nimport myVitePlugin from './my-vite-plugin.mjs';\n\nexport default {\n  html: {\n    bundler: createViteBundler({\n      plugins: [myVitePlugin()],\n      define: {\n        'process.env.ANALYTICS_ID': JSON.stringify('UA-XXXXX'),\n      },\n      resolve: {\n        alias: {\n          '@components': './src/components',\n        },\n      },\n      css: {\n        lightningcss: {\n          targets: {\n            chrome: 100 &#x3C;&#x3C; 16,\n          },\n        },\n      },\n    }),\n  },\n};\n</code></pre>\n<p>The generator owns the fields required to coordinate its builds: config-file\nloading, app type and base, virtual inputs, Preact compatibility aliases and\nautomatic JSX runtime, the Lightning CSS transformer, output/write mode, SSR\nformat and output, and SSR dependency bundling. Values supplied for those\nfields are replaced after configuration is merged. User plugins are registered\nafter the generator's virtual-module plugin; other Vite options are preserved.</p>\n<p>Vite builds the client entry as a module, not the pages as HTML entries, so\nplugins see and can transform every module of the client and server builds but\nnever the HTML pages. Customize the pages through the\n<a href=\"#html-template\">HTML template</a> instead.</p>\n<p>The adapter reads the client asset names from Vite's manifest. A manifest is\nwritten either way; pass <code>build: { manifest: true }</code> (or a file name) to\n<code>createViteBundler</code> to keep it in the output for another tool.</p>\n<p>The adapter is only ever used on the main thread, so function-valued plugins\nand hooks are supported. Worker threads receive the <code>html</code> configuration with\nits function values removed.</p>",
              "displayName": "Vite adapter"
            },
            {
              "textRaw": "Default `imports`",
              "name": "default_`imports`",
              "type": "module",
              "desc": "<ul>\n<li><code>#theme/Logo</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> Logo rendered inside the navigation bar. Defaults to\nthe built-in <code>ProjectName</code> component, which renders <code>project</code> as plain text.</li>\n<li><code>#theme/Navigation</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> Top navigation bar. Defaults to the built-in\n<code>NavBar</code> component.</li>\n<li><code>#theme/Sidebar</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> Sidebar with version selector and page links.\nDefaults to the built-in <code>SideBar</code> component.</li>\n<li><code>#theme/Metabar</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> Metadata bar displayed alongside page content.\nDefaults to the built-in <code>MetaBar</code> component.</li>\n<li><code>#theme/Footer</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> Optional footer rendered at the bottom of each page.\nDefaults to the built-in <code>NoOp</code> component, which renders nothing.</li>\n<li><code>#theme/Layout</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> Outermost wrapper around the full page. Defaults to\nthe built-in <code>Layout</code> component.</li>\n</ul>\n<p>Override any alias in your config file to swap in a custom component:</p>\n<pre><code class=\"language-js\">// doc-kit.config.mjs\nexport default {\n  html: {\n    imports: {\n      '#theme/Logo': './src/MyLogo.jsx',\n      '#theme/Sidebar': './src/MySidebar.jsx',\n    },\n  },\n};\n</code></pre>",
              "displayName": "Default `imports`"
            }
          ],
          "displayName": "Configuring"
        },
        {
          "textRaw": "`components`",
          "name": "`components`",
          "type": "module",
          "desc": "<p><code>components</code> registers custom JSX components so they can be used directly in\ncontent (see <a href=\"#jsx-in-mdx\">JSX-in-MDX</a> below). Each entry maps a JSX tag name to\nan import descriptor (<code>{ name, source, isDefaultExport? }</code>, the same shape as the\nbuilt-in <code>JSX_IMPORTS</code>). A <code>Tag: 'source'</code> string shorthand expands to\n<code>{ name: Tag, source }</code> with a default export. Registered components are merged\nwith the built-ins, and a matching <code>imports</code> alias resolves the <code>source</code> to a\nreal module path:</p>\n<pre><code class=\"language-js\">// doc-kit.config.mjs\nexport default {\n  html: {\n    components: {\n      // Shorthand — equivalent to { name: 'Hero', source: '#theme/Hero' }\n      Hero: '#theme/Hero',\n      // Full descriptor\n      Stats: { name: 'Stats', source: '#theme/Stats' },\n    },\n    imports: {\n      '#theme/Hero': './src/components/Hero.jsx',\n      '#theme/Stats': './src/components/Stats.jsx',\n    },\n  },\n};\n</code></pre>",
          "displayName": "`components`"
        },
        {
          "textRaw": "JSX-in-MDX",
          "name": "jsx-in-mdx",
          "type": "module",
          "desc": "<p>By default every input file is parsed as Markdown, where bare <code>&#x3C;</code> and <code>{</code> are\ntreated literally (Node.js core docs use <code>&#x3C;string></code>-style type annotations). To\nauthor real JSX — <code>&#x3C;Hero /></code>, <code>{expression}</code> — use an <strong><code>.mdx</code></strong> file, or set\n<code>mdx: true</code> in a file's <code>---</code> frontmatter (frontmatter wins, so <code>mdx: false</code>\nopts a <code>.mdx</code> file back out). MDX files are parsed with <code>remark-mdx</code> and skip the\nAPI-doc type/signature parsing; headings, frontmatter, TOC, and sidebar still\nwork. Reference any component registered via <code>components</code>:</p>\n<pre><code class=\"language-mdx\">---\ntitle: Welcome\n---\n\n# Welcome\n\n&#x3C;Hero title=\"Node.js\" />\n\nThere are {stats.length} APIs documented.\n</code></pre>\n<p>The built-in components are available without registration. Notably,\n<code>&#x3C;DocumentationIndex /></code> renders an index of every documented module with its\nstability badge and description, sourced from the <code>documentationIndex</code> export\nof <a href=\"#themeconfig-virtual-module\"><code>#theme/config</code></a>.</p>",
          "displayName": "JSX-in-MDX"
        },
        {
          "textRaw": "`#theme/config` virtual module",
          "name": "`#theme/config`_virtual_module",
          "type": "module",
          "desc": "<p>The <code>html</code> generator provides a <code>#theme/config</code> virtual module that exposes pre-computed configuration as named exports. Any component (including custom overrides) can import the values it needs, and tree-shaking removes the rest.</p>\n<pre><code class=\"language-js\">import { project, repository, editURL } from '#theme/config';\n</code></pre>",
          "modules": [
            {
              "textRaw": "Available exports",
              "name": "available_exports",
              "type": "module",
              "desc": "<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> Project name (e.g. <code>'Node.js'</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, or\n<code>undefined</code> when none is configured.</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></code> Current version label (e.g. <code>'v22.x'</code>).</li>\n<li><code>versions</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Pre-computed version entries, each <code>{ url, label, major }</code>,\nwith labels and URL templates (only <code>{path}</code> remains for per-page use).</li>\n<li><code>editURL</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> Partially populated \"edit this page\" URL template (only\n<code>{path}</code> remains).</li>\n<li><code>pages</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Sorted <code>[name, path]</code> tuples for sidebar navigation.</li>\n<li><code>documentationIndex</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Entries rendered by the built-in\n<code>&#x3C;DocumentationIndex /></code> component — every page with a stability index, each\n<code>{ api, name, index, description }</code>.</li>\n<li><code>chunks</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Per-module section pages produced by the\n<a href=\"./section-pages.html\"><code>section-pages</code></a> generator, keyed by the module's path: each\n<code>{ label, items }</code>, where <code>items</code> is the module's section tree — <code>{ label, path, items? }</code> entries nested by heading depth, in document order. Empty\nunless <code>section-pages</code> ran.</li>\n<li><code>navigation</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Mirrors the configured <code>navigation</code> (consumed by the\nbuilt-in <code>SideBar</code> and <code>NavBar</code>).</li>\n<li><code>useAbsoluteURLs</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 internal links use absolute URLs (mirrors\nconfig value).</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></code> Base URL for the documentation site (used when\n<code>useAbsoluteURLs</code> is <code>true</code>).</li>\n<li><code>languageDisplayNameMap</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map\" class=\"type-link\">Map</a>&#x3C;<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/en-US/docs/Web/JavaScript/Data_structures#string_type\" class=\"type-link\">string</a>></code> Shiki language alias → display\nname map for code blocks.</li>\n<li><code>remoteConfigUrl</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> Mirrors the configured <code>remoteConfigUrl</code> (fetched\nclient-side by <code>RemoteLoadableBanner</code> to load announcement banners).</li>\n<li><code>server</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 the current bundle is the server build.</li>\n</ul>",
              "displayName": "Available exports"
            },
            {
              "textRaw": "Usage in custom components",
              "name": "usage_in_custom_components",
              "type": "module",
              "desc": "<p>When overriding a <code>#theme/*</code> component, import only the config values you need:</p>\n<pre><code class=\"language-jsx\">// my-custom-sidebar.jsx\nimport { pages, versions, version } from '#theme/config';\n\nexport default ({ metadata }) => (\n  &#x3C;nav>\n    &#x3C;p>Current: {version}&#x3C;/p>\n    &#x3C;ul>\n      {pages.map(([name, path]) => (\n        &#x3C;li key={path}>\n          &#x3C;a href={`${path}.html`}>{name}&#x3C;/a>\n        &#x3C;/li>\n      ))}\n    &#x3C;/ul>\n  &#x3C;/nav>\n);\n</code></pre>",
              "displayName": "Usage in custom components"
            }
          ],
          "displayName": "`#theme/config` virtual module"
        },
        {
          "textRaw": "Layout props",
          "name": "layout_props",
          "type": "module",
          "desc": "<ul>\n<li><code>metadata</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Serialized page metadata — all YAML frontmatter properties\nplus <code>addedIn</code>, <code>basename</code>, <code>path</code>, and any custom user-defined fields. Pages\nproduced by the <a href=\"./section-pages.html\"><code>section-pages</code></a> generator also carry <code>chunk</code>, which\ndescribes the module and section they were split from.</li>\n<li><code>headings</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\" class=\"type-link\">Array</a></code> Pre-computed table of contents heading entries.</li>\n<li><code>readingTime</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/en-US/docs/Web/JavaScript/Data_structures#undefined_type\" class=\"type-link\">undefined</a></code> Estimated reading time (e.g. <code>'5 min read'</code>).\nOnly present when the <code>jsx-ast</code> generator's <code>showReadingTime</code> option is\nenabled. <code>all.html</code> has none.</li>\n<li><code>children</code> <code class=\"type\">ComponentChildren</code> Processed page content.</li>\n</ul>\n<p>The <code>Layout</code> component receives the props above. Custom Layout components can use\nany combination of them alongside <code>#theme/config</code> imports.</p>",
          "displayName": "Layout props"
        },
        {
          "textRaw": "HTML template",
          "name": "html_template",
          "type": "module",
          "desc": "<p>The HTML template file (set via <code>templatePath</code>) uses JavaScript template literal syntax (<code>${...}</code> placeholders) and is evaluated at build time with full expression support.</p>",
          "modules": [
            {
              "textRaw": "Available template variables",
              "name": "available_template_variables",
              "type": "module",
              "desc": "<ul>\n<li><code>title</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> Fully resolved page title (e.g.\n<code>'File system | Node.js v22.x'</code>).</li>\n<li><code>dehydrated</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> Server-rendered HTML for the page content.</li>\n<li><code>assets</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> The <code>&#x3C;script></code> and <code>&#x3C;link></code> tags loading the client\nassets, resolved against this page's location.</li>\n<li><code>speculationRules</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> Speculation rules JSON for prefetching.</li>\n<li><code>themeScript</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> Inline script that applies the saved theme before paint.</li>\n<li><code>root</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> Relative or absolute path to the site root.</li>\n<li><code>metadata</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> Full page metadata (frontmatter, path, heading, etc.).</li>\n<li><code>config</code> <code class=\"type\"><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type-link\">Object</a></code> The resolved <code>html</code> generator configuration.</li>\n<li><code>head</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> Pre-rendered <code>&#x3C;meta></code>/<code>&#x3C;link></code>/raw markup from the <code>head</code>\nconfig.</li>\n</ul>\n<p>Since the template supports arbitrary JS expressions, you can use conditionals and method calls:</p>\n<pre><code class=\"language-html\">&#x3C;title>${title}&#x3C;/title> ${assets}\n</code></pre>\n<p>The populated page is the final HTML: it is minified when <code>minify</code> is set and\nwritten as is. Put <code>${assets}</code> in the <code>&#x3C;head></code>, or the page loads no script and\nno stylesheet.</p>",
              "displayName": "Available template variables"
            }
          ],
          "displayName": "HTML template"
        }
      ],
      "displayName": "`html` Generator"
    }
  ]
}