What's the easiest way to cause JsDoc to leave out the source links? Do I have to define my own template?
2 Answers
If you use the default template, then use a configuration file with templates.default.outputSourceFiles
set to false
. For instance:
{
"templates": {
"default": {
"outputSourceFiles": false
}
}
}
You'd pass the path to this file to jsdoc using the -c
option on the command line.
I don't see this option documented in any actual jsdoc documentation. I've found it mentioned in this issue and this one.
The template is the entity providing this functionality so if you use another template than the default one, you have to check its documentation to find whether there is a setting you can set to do this.

- 146,715
- 28
- 274
- 320
-
1To complete you may need to set both "outputSourceFiles" : false, "outputSourcePath" : false, as read on https://github.com/terryweiss/docstrap#configuring-the-template – Chris Nov 08 '14 at 11:04
-
3@Chris That's true if you are using Docstrap, and this ties into my last paragraph about using templates other than the default one. I just grepped the latest stable release of jsdoc for `outputSourcePath` and it is nowhere to be found. – Louis Nov 08 '14 at 11:12
In order to remove source file links, we need to create a file named jsdoc.json
and add:
{
"templates":{
"default":{
"outputSourceFiles":false
}
}
}
Then run:
jsdoc -c jsdoc.json calculator.js
Here calculator.js
is the main file (your actual file that is going to be documented) and jsdoc.json
is the configuration file. To run the configuration file I used –c
option.
So, basically all you need to do is to just create a file called jsdoc.json
and add the above mentioned code and save it. After saving run this command:
jsdoc -c jsdoc.json calculator.js

- 1,393
- 4
- 20
- 26

- 11
- 1