Skip to content
Advertisement

JSDoc: How do you include a custom css file template in your generated docs?

The JSDoc docs say

Copying a directory of images to the output directory. To copy all of the static files in ./myproject/static to the output directory:

JavaScript

If your static files directory contains the file ./myproject/static/img/screen.png, you can display the image in your docs by using the HTML tag <img src="img/screen.png">.

And so I have this in my jsdoc.config.json

JavaScript

My css file gets added to the folder with my generated docs,

but I would really like all my generated docs to include that css file, and not have to manually put a <style src="index.css" /> tag manually into my auto-generated docs


It’s not there in the head of my auto generated docs, as you can see from the picture below

I would like the head to be something like

JavaScript

Advertisement

Answer

I think you may need to provide a custom layout (HTML) file using templates.default.layoutFile configuration property.

JavaScript

The path to the file is relative to:

Relative paths are resolved against the current working directory; the path to the configuration file; and the JSDoc directory, in that order.


This is an example template file to use for templates.default.layoutfile

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement