-
Notifications
You must be signed in to change notification settings - Fork 152
The @typicalname tag
Nathan McCallum edited this page Apr 26, 2019
·
2 revisions
1. Say you wrote Underscore.
/**
* @module underscore
*/
/**
* Find something where.
*/
exports.findWhere = function () {}
/**
* Flatten an array.
*/
exports.flatten = function () {}
2. In the output, all method signatures start with underscore.
:
Find something where.
Kind: static method of underscore
Flatten an array.
Kind: static method of underscore
3. But nobody writes underscore.
, typically they write _.
. To reflect this, use the jsdoc2md-specific @typicalname
tag:
/**
* @module underscore
* @typicalname _
*/
/**
* Find something where.
*/
exports.findWhere = function () {}
/**
* Flatten an array.
*/
exports.flatten = function () {}
4. Now the output looks more realistic:
Find something where.
Kind: static method of underscore
Flatten an array.
Kind: static method of underscore
- Home
- How jsdoc2md works
- Additional jsdoc tags supported
- Cherry picking which documentation appears in output
- Showcase ...
- Create ...
- How To ...
- How to use with npm run
- How to use with gulp
- How to create one output file per class
- How to document a AMD module
- How to document a CommonJS module (exports)
- How to document a CommonJS module (module.exports)
- How to document an ES2015 module (multiple named exports)
- How to document an ES2015 module (single default export)
- How to document Promises (using custom tags)
- How to document a ToDo list
- How to document ES2017 features
- How to document TypeScript
- The @typicalname tag
- Linking to external resources
- Param list format options
- Listing namepaths
- Troubleshooting