generate-md.mjs. It calls Application.bootstrapWithPlugins, passes a configuration object, converts the webpack type definitions, and writes the output.
The full script
generate-md.mjs
TypeDoc options
| Option | Value | Purpose |
|---|---|---|
entryPoints | ["./webpack/types.d.ts"] | Single entry point — webpack’s top-level type declaration file. |
out | pages/v${major(webpack.version)}.x | Output directory, e.g. pages/v5.x. |
plugin | (see below) | List of plugins to load before processing. |
theme | "doc-kit" | Uses the custom theme registered by theme/index.mjs. |
hideGroupHeadings | true | Suppresses group heading elements in rendered Markdown. |
hideBreadcrumbs | true | Removes breadcrumb navigation from each page. |
hidePageHeader | true | Removes the auto-generated page header from each page. |
disableSources | true | Omits “defined in” source-file links from the output. |
router | "module" | Organises output by module, one file per exported module. |
entryFileName | "index" | Names the root output file index.md instead of the default. |
Output directory naming
Theout path is computed at runtime using webpack’s own package.json:
This relies on the
semver package’s major() function to extract the major version number from webpack’s version string. For webpack 5.105.4 this produces the directory pages/v5.x.Plugins
typedoc-plugin-markdown
The official TypeDoc Markdown renderer. It replaces TypeDoc’s default HTML theme with one that emits.md files, which downstream tools (including @node-core/doc-kit) can process further.
plugins/processor.mjs
Runs two transformations on the TypeDoc reflection tree and one post-render step: DuringConverter.EVENT_RESOLVE_BEGIN:
- Accessor-to-property conversion — TypeDoc models getters and setters as
Accessorreflections. The processor downcasts each one toPropertyand copies the type and comment from the getter (or setter) signature. This simplifies the rendered output. - Namespace merging — webpack’s
types.d.tsusesexport=namespaces. The processor finds everyNamespacereflection namedexport=and merges it into its parent, flattening the hierarchy.
Renderer.EVENT_END:
- Type-map generation — After all pages are written, the processor iterates every routable reflection, builds a map of
fullyQualifiedName → URL(with.mdreplaced by.html), and writes it totype-map.jsoninside theoutdirectory.@node-core/doc-kituses this map to resolve cross-type links when building HTML.
plugins/theme/index.mjs
Registers thedoc-kit theme used by the theme option:
plugins/theme/index.mjs
DocKitTheme extends MarkdownTheme and overrides getRenderContext to enforce propertiesFormat: table on every page render. DocKitThemeContext wires in custom helpers and partials that control how individual reflection kinds are formatted.