Running JSDoc generation - Yoast/wordpress-develop-mirror GitHub Wiki

Installation

Install JSDoc globally using Yarn:

yarn global add jsdoc

Running

jsdoc {path to file(s)}

To specify where you want the output files to go, use the -d modifier:

jsdoc {path to file(s)} -d docs

See: http://usejsdoc.org/about-commandline.html

File Watcher (PHPStorm)

To auto-generate the docs for you, use the following configuration in PHPStorm File Watchers: edit_watcher_and_preferences


Herre has added the JSDoc Grunt command to WordPress itself as well, so these can be run on the latest master. Make sure you install all packages in the root of the project.

yarn install

Run the JSDoc Grunt command:

grunt jsdoc

This will place the generated documentation in the jsdoc folder in the root of the project. Please note: there will be a lot of warnings and possibly errors, these are expected until we fix all documentation.