Overview
The Legacy HTML generator produces the legacy version of the API documentation in HTML format, including all assets and styles as separate files. This generator provides retro-compatibility while newer generators are being implemented.Metadata
Generator identifier
Generator version
Requires metadata generator output as input
Supports parallel processing for improved performance
Configuration
Path to the HTML template file
Array of paths to copy to output (e.g., assets folder)Default:
Git reference (branch/tag) for source links
Output directory path for generated HTML files and assets
Optional index configuration for custom navigation ordering
Enable HTML minification for production builds
Output Format
The generator produces:- HTML files: One per API module (e.g.,
http.html,fs.html) - Assets folder: Copied from
additionalPathsToCopy - Navigation: Generated table of contents with active states
Usage
Dependency Chain
- ast - Parses Markdown to AST
- metadata - Extracts API metadata
- legacy-html - Renders to legacy HTML format
Implementation Details
The generator:- Groups nodes by module using
groupNodesByModule - Generates navigation from heading nodes
- Processes chunks in parallel using worker threads
- Builds table of contents with syntax highlighting via Shiki
- Replaces template values with generated content
- Optionally minifies HTML output
- Copies asset files to output directory
Parallel Processing
TheprocessChunk function runs in worker threads:
- Builds navigation with active class for current page
- Generates table of contents (max depth: 4)
- Builds content with syntax-highlighted code blocks
- Returns template objects for file writing
src/generators/legacy-html/