generate command is the primary command for generating API documentation. It processes markdown files from the Node.js repository and outputs documentation in various formats.
Usage
Global Options
These options apply to the entiredoc-kit CLI, not just the generate command.
Set the logging verbosity level. Controls how much diagnostic information is printed during execution.Choices:
debug, info, warn, error, fatalDefault: infoExample: --log-level debugCommand Options
Path to a configuration file. When provided, the configuration file will be loaded and merged with CLI options and defaults.
Input file patterns using glob syntax. Specify one or more glob patterns to match the markdown files you want to process.Example:
-i "path/to/node/doc/api/*.md"Target generator(s) to use for output. You can specify multiple generators to produce different output formats simultaneously.Available generators:
json-simple- Simple JSON outputlegacy-html- Legacy HTML format (1:1 match with Node.js legacy tooling)legacy-html-all- Legacy HTML all-in-one formatman-page- Man page formatlegacy-json- Legacy JSON formatlegacy-json-all- Legacy JSON all-in-one formataddon-verify- Addon verificationapi-links- API links generatororama-db- Orama database for search functionalityllms-txt- LLMs.txt formatsitemap- Sitemap generatorweb- Redesigned web pages
File patterns to ignore during processing. Uses glob syntax to exclude files.Example:
--ignore "**/internal/**" "**/*.test.md"The output directory where generated documentation will be written.Example:
-o out or -o dist/docsNumber of threads to use for parallel processing. Must be at least 1.Default: Number of CPU cores available (automatically detected)
Number of items to process per worker thread. Must be at least 1.Default:
10Target Node.js version in semver format. This is used for version-specific documentation generation.Default: Current Node.js version (e.g.,
v22.14.0)Changelog URL or local file path. Used to incorporate changelog information into the generated documentation.Default:
https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.mdGit ref URL for linking to source code. This creates links to the specific commit or branch in the repository.Default:
https://github.com/nodejs/node/tree/HEADURL or path to the index.md file. This file typically contains the main documentation index.Example:
--index path/to/node/doc/api/index.mdEnable minification of output files.Default:
trueURL or path to a type map file for type reference mapping.
Examples
Legacy HTML and JSON Output
To generate a 1:1 match with the legacy Node.js documentation tooling:Redesigned Web Documentation
To generate the redesigned documentation pages with search functionality:To use the search functionality, you must serve the output directory:
Multiple Generators
Generate multiple output formats simultaneously:Custom Configuration
Specify custom settings for version, changelog, and threading:Using a Configuration File
Use a configuration file to manage complex settings:Performance Tips
Optimize Thread Count
Optimize Thread Count
The
--threads option controls parallel processing. By default, it uses all available CPU cores. For optimal performance:- Use fewer threads on machines with limited memory
- Increase
--chunk-sizewhen processing many small files - Decrease
--chunk-sizewhen processing large files
Multiple Generators
Multiple Generators
When using multiple generators, they run in parallel. The total processing time is roughly equivalent to the slowest generator.
Minification
Minification
Minification is enabled by default. Disable it with
--minify false during development to improve readability of output files.Additional Resources
- Configuration - Learn about configuration files and options
- Generators - Explore available generators and create custom ones