Creates a new Writer instance for generating documentation output
Parsed API data and project information from the core parser
Application context containing shared instances and configuration
Cache-busting query parameter for static assets. Defaults to current timestamp to ensure fresh assets on each build.
Private
authPrivate
initializeInitialize authentication system if login configuration is present
Write output files based on configuration.
If dry run mode is enabled, no files are created, and the method simply logs the operation and resolves the promise. Otherwise, it creates the necessary files either as a single file or multiple output files based on the specified options.
Promise that resolves when file writing is complete.
Create output files in the destination directory
Performs the following tasks:
index.html
file into the destination directory.assets
folder within the destination directory.api-data.json
into the assets folder if the writeJson
option is enabled.Resolves as the bundling operation assets folder.
Read image files from a directory, then convert them to Base64 strings and map them to tokens.
A mapping of token keys to Base64-encoded image strings, where each
key is in the format "IMAGE_LINK_TOKEN_
Process custom markdown settings from apidoc.json
Project configuration from apidoc.json
Object containing processed markdown content for each group
Generate and return the content of the index.html
file for the API documentation.
Replaces predefined tokens with dynamic values such as the project title, description, and cache-busting query parameters.
Processed HTML content for the index page of the API documentation.
Create a self-contained single HTML file by bundling CSS and JS into the file
A promise that resolves once the single HTML file is successfully created.
Documentation output writer and asset bundler
The Writer class is responsible for:
Example: Basic usage
Example: Custom cache busting
Since
4.0.0
Public