Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 4.17 KB

generators.md

File metadata and controls

73 lines (53 loc) · 4.17 KB

Generators

A generator is an output format.

npx @doc-kit/cli generate -t html -t orama-db -t sitemap -i "docs/**/*.md" -o out

Built-in generators

Target Output
html The modern documentation site: server-rendered, hydrated, themeable.
orama-db The search index behind the html site's search box.
llms-txt An llms.txt index for language models.
llms-txt-full Every page's Markdown in one llms-full.txt, for language models.
sitemap A sitemap.xml for search engines.
section-pages The html site and sitemap, plus one page per section of a module.
Target Output
json One schema-described JSON document per source file.
json-all Those documents bundled into a single all.json.
json-simple A dump of the parsed metadata entries, for debugging the pipeline.

1:1 matches for Node.js's original documentation tooling, for consumers of the classic layouts.

Target Output
legacy-html One classic HTML page per document.
legacy-html-all The single-page all.html bundle.
legacy-json The classic per-document JSON.
legacy-json-all The single-file JSON bundle.

Node.js-specific (@node-core/doc-kit)

Outputs consumed by the Node.js project's own build and release processes.

Target Output
man-page The node.1 manual page.
api-links A map of API symbols to their source locations.
addon-verify Extracted addon code samples, arranged for testing.

Pipeline stages

The targets above are built on a few shared stages, each of which is itself a generator.

Stage Produces
ast Markdown parsed into MDAST, across worker threads.
ast-js JavaScript sources parsed into an AST.
metadata The flattened API entries every output is built from.
jsx-ast Those entries as JSX, ready for the web generators.

Custom generators

A target can also be an import specifier — a package export or a local file whose default export is a generator:

npx @doc-kit/cli generate -t @my-scope/my-generator -t ./generators/rss.mjs ...

To build one, see Creating generators.