jbt / docker

Documentation generator
http://jbt.github.com/docker
MIT License
234 stars 56 forks source link

Optional parameters and default values in jsdoc #70

Open AlexanderZeilmannTNG opened 10 years ago

AlexanderZeilmannTNG commented 10 years ago

I modified (see this commit) some jsdoc related parts to support optional parameters and default values. Optional parameters can be written like this:

/**
 * @param {number} [optionalParameter] Description
 */

And an optional parameter with default value like this:

/**
 * @param {number} [withDefault=42] Description
 */

I also fixed a bug where a "-" between the parameter name and description was interpreted as bullet point. (The dash is allowed in jsdoc to improve readability.)

/**
 * @param {number} parameterName - Description
 */

Furthermore I moved the description of a parameter (and of return values) in the html output to a new line to improve readability.

If you want I can send a pull request and/or change something.