Default Template
Overview
JSDoc ships with the "default" template that produces clean, readable HTML. You can customise it through the templates key in your configuration file.
Configuration options
{
"templates": {
"cleverLinks": false,
"monospaceLinks": false,
"default": {
"outputSourceFiles": true,
"includeDate": true,
"layoutFile": "path/to/layout.tmpl",
"staticFiles": {
"include": ["path/to/extra-assets"]
}
}
}
}
Top-level template options
| Option | Type | Default | Description |
|---|---|---|---|
cleverLinks | boolean | false | When true, {@link} uses monospace for URLs and normal text for other links. |
monospaceLinks | boolean | false | When true, all {@link} text is rendered in monospace. |
templates.default options
| Option | Type | Default | Description |
|---|---|---|---|
outputSourceFiles | boolean | true | Include syntax-highlighted source files in the output. |
includeDate | boolean | true | Include the generation date in the footer. |
layoutFile | string | — | Path to a custom layout template (.tmpl file). |
staticFiles.include | string[] | — | Extra directories whose contents are copied into the output. |
Disabling source files
If you do not want to expose your source code in the output:
{
"templates": {
"default": {
"outputSourceFiles": false
}
}
}
Using a custom layout
Point to your own layout template:
{
"templates": {
"default": {
"layoutFile": "custom-layout.tmpl"
}
}
}
Adding static assets
Copy an assets/ folder into the output:
{
"templates": {
"default": {
"staticFiles": {
"include": ["assets"]
}
}
}
}
See also
Official reference: jsdoc.app/about-configuring-default-template