Is it possible to generate a JSDoc documentation in IDEA / WebStorm with one click, just like I do JavaDoc with IntelliJ IDEA.
Install jsdoc
to the Node.js project: npm i jsdoc
Prepare a JSDoc configuration file (jsdoc.json
) and store it in the root of the project
Go to File | Settings | Tools | External Tools in IntelliJ IDEA / WebStorm
Add a new external tool called Generate JSDoc… of group Documentation.
In Tool Settings provide the following parameters:
Program: path to the Node.js binary, e.g.: C:\Program Files\nodejs\node.exe
Arguments: path to JSDoc scripts and to the JSDoc config (jsdoc.json
), e.g.: $ProjectFileDir$/node_modules/jsdoc/jsdoc.js -c $ProjectFileDir$/jsdoc.json
Here it is possible either specify absolute paths or provide a relative path using IDE's internal command $ProjectFileDir$
Working directory: path to the sources, e.g.: $ProjectFileDir$\src
Press OK and Apply
Now, go to Tools → Documentation → Generate JSDoc…, et voilà, the JSDoc is generated and stored according to the JSDoc config (jsdoc.json
).
P.S. This guide is tested on IntelliJ IDEA 2021.2.