{"$schema":"https://doc-kit.nodejs.org/schemas/api-doc/1.0.1.json","id":"generators-metadata","path":"/generators/metadata","type":"module","module":"generators-metadata","title":"API entries","introducedIn":null,"sourceLink":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"The `metadata` stage turns your parsed Markdown into a flat list of API\nentries, one per heading, each with its kind, stability, history and linked\ntypes. Every output except `api-links` is built from these entries, and\nthey're what a generator of your own usually reads.\n\nYou don't ask for this stage: any target that reads API entries runs it, once\nper run. To look at the entries themselves, run the\n[Debug JSON](https://doc-kit.nodejs.org/generators/json-simple) target.","summary":"The `metadata` stage turns your parsed Markdown into a flat list of API entries, one per heading, each with its kind, stability, history and linked types. Every output except `api-links` is built from these entries, and they're what a generator of your own usually reads.","examples":[],"children":[{"kind":"section","id":"configuring","name":"Configuring","title":"Configuring","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"* `typeMap` {string} The path or URL of a JSON file mapping type names to the\n  pages documenting them. `--type-map` sets it too. See\n  [Types that link themselves](https://doc-kit.nodejs.org/writing-docs#types-that-link-themselves)\n  and [The type map](https://doc-kit.nodejs.org/writing-docs#the-type-map).","summary":"","examples":[],"children":[]},{"kind":"section","id":"what-an-entry-holds","name":"What an entry holds","title":"What an entry holds","scope":"module","overloadOf":null,"stability":null,"added":[],"deprecated":[],"removed":[],"napiVersion":[],"changes":[],"description":"Each heading of level 1 to 5 starts an entry, which runs until the next such\nheading, whatever its level. Unlike an entry in the\n[specification](https://doc-kit.nodejs.org/specification#12-definitions), it\ndoesn't hold the entries below it: outputs rebuild the hierarchy from the\nheading levels. Anything before a file's first heading belongs to its\nfirst entry, and a file without headings gets one entry, under an empty\nlevel-1 heading that isn't rendered.\n\n| Field       | Type      | Holds                                                                                                                              |\n| ----------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| `api`       | `string`  | The file's identifier, made from its path: `/guide/widgets` becomes `guide-widgets`. Every entry of a file shares it.              |\n| `path`      | `string`  | The file's path without its extension, from the directory its `input` glob starts at: `docs/guide/widgets.md` is `/guide/widgets`. |\n| `basename`  | `string`  | The last segment of `path`, such as `widgets`.                                                                                     |\n| `mdx`       | `boolean` | Whether the file was parsed as MDX.                                                                                                |\n| `heading`   | `Object`  | The heading, as an mdast `heading` node. Its `data` holds its `text`, `name`, `slug` and kind (`type`).                            |\n| `stability` | `Object`  | The section's stability index, as its blockquote node, when it has one. Its `data` holds `index` and `description`.                |\n| `content`   | `Object`  | The section as an mdast `root` node: the heading, then everything up to the next entry, without its metadata comments.             |\n\nThe keys of the section's metadata comments, such as `added`, `changes` and\n`llm_description`, are fields of the entry too. The `MetadataEntry` type in\n[`types.d.ts`](https://github.com/nodejs/doc-kit/blob/main/packages/core/src/generators/metadata/types.d.ts)\ndescribes the whole shape; a generator imports it from\n`@doc-kit/core/generators/metadata/types`.\n\nA generator reads the entries by declaring\n`dependsOn: '@doc-kit/core/metadata'`, as\n[Creating generators](https://doc-kit.nodejs.org/creating-generators#input-and-output)\nshows. It receives every entry in one array. Each file's entries stay together,\nin document order, but files arrive in the order their chunks finish, not the\norder of `input`.","summary":"Each heading of level 1 to 5 starts an entry, which runs until the next such heading, whatever its level. Unlike an entry in the specification, it doesn't hold the entries below it: outputs rebuild the hierarchy from the heading levels. Anything before a file's first heading belongs to its first entry, and a file without headings gets one entry, under an empty level-1 heading that isn't rendered.","examples":[],"children":[]}]}