Skip to main content

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​

OptionTypeDefaultDescription
cleverLinksbooleanfalseWhen true, {@link} uses monospace for URLs and normal text for other links.
monospaceLinksbooleanfalseWhen true, all {@link} text is rendered in monospace.

templates.default options​

OptionTypeDefaultDescription
outputSourceFilesbooleantrueInclude syntax-highlighted source files in the output.
includeDatebooleantrueInclude the generation date in the footer.
layoutFilestring–Path to a custom layout template (.tmpl file).
staticFiles.includestring[]–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​