Documentation Comments

Traditional multi-line comments in JS++ are declared using the /* ... */ syntax. In order to write documentation comments, include an extra asterik (*) at the start of a multi-line comment using the /** ... */ syntax.

Documentation comments must immediately precede the item (e.g. class, method, function, etc.) that you are trying to document. Whitespace and other comments are ignored when determining which item follows a documentation comment.

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * This is an example of a documentation comment.
 *
 * In can span any number of lines.
 *
 * It should immediately precede the item (e.g. class, method, etc.) you are
 * trying to document.
 *
 * @summary This is an example class.
 * @example Instantiating
 *     new Foo();
 */
class Foo
{
}

The description should always appear first. After the description, tags can be defined. Tags begin with @ and allow us to define specific properties of the documentation page.

Documentation comments support Markdown for markup.

Share

HTML | BBCode | Direct Link