Getting Started with JSDoc 3
Table of Contents
Adding Documentation Comments to Your Code
JSDoc comments should generally be placed immediately before the code being documented. It must start with a
/** sequence in order to be recognized
by the JSDoc parser. Comments beginning with
/***, or more than 3 stars will be ignored. This is a feature to allow you to suppress
parsing of comment blocks.
Adding a description is simple, just type the description you want in the documentaton comment.
Special "documentation tags" can be used to give more information. For example, if the function is a constructor, you can indicate this by adding a tag.
More tags can be used to add more information. See the Tag Dictionary for a complete list of tags that are recognized by JSDoc 3.
Generating A Website
Once your code is commented, you can use the JSDoc 3 Tool to generate an HTML website from the source.
By default, JSDoc will use the "default" template to turn the documentation data into HTML. You can edit this template to suit your own needs, or create an entirely new template if that is what you prefer.
This command will create a folder named "out" in the current working directory. Within that you will find the generated HTML pages.