Markdown / JSdoc documentation generator
方法 | module.exports() | module | exports |
Expose api.
属性 | exports.api | exports | api |
Parse comments in the given string of js
.
方法 | exports.parseComments() | exports | parseComments |
参数 | js(String) | ||
参数 | options(Object) | ||
返回 | Array | ||
undefined | undefined | undefined | undefined |
可见度 | public |
Removes excess indentation from string of code.
方法 | exports.trimIndentation() | exports | trimIndentation |
参数 | str(String) | ||
返回 | String | ||
可见度 | public |
Parse the given comment str
.
The comment object returned contains the following
tags
array of tag objectsdescription
the first line of the commentbody
lines following the descriptioncontent
both the description and the bodyisPrivate
true when "@api private" is used方法 | exports.parseComment() | exports | parseComment |
参数 | str(String) | ||
参数 | options(Object) | ||
返回 | Object | ||
undefined | undefined | undefined | undefined |
可见度 | public |
Extracts different parts of a tag by splitting string into pieces separated by whitespace. If the white spaces are
somewhere between curly braces (which is used to indicate param/return type in JSDoc) they will not be used to split
the string. This allows to specify jsdoc tags without the need to eliminate all white spaces i.e. {number | string}
方法 | exports.extractTagParts() | exports | extractTagParts |
参数 | The(str) | tag line as a string that needs to be split into parts | |
undefined | Array.<string> | undefined | An array of strings containing the parts |
Parse tag string "@param {Array} name description" etc.
方法 | exports.parseTag() | exports | parseTag |
参数 | (String) | ||
返回 | Object | ||
可见度 | public |
Parse tag type string "{Array|Object}" etc.
This function also supports complex type descriptors like in jsDoc or even the enhanced syntax used by the
google closure compiler
The resulting array from the type descriptor {number|string|{name:string,age:number|date}}
would look like this:
[
'number',
'string',
{
age: ['number', 'date'],
name: ['string']
}
]
方法 | exports.parseTagTypes() | exports | parseTagTypes |
参数 | str(String) | ||
返回 | Array | ||
可见度 | public |
Determine if a parameter is optional.
Examples:
JSDoc: {Type} [name]
Google: {Type=} name
TypeScript: {Type?} name
方法 | exports.parseParamOptional() | exports | parseParamOptional |
参数 | tag(Object) | ||
返回 | Boolean | ||
可见度 | public |
Parse the context from the given str
of js.
This method attempts to discover the context
for the comment based on it's code. Currently
supports:
方法 | exports.parseCodeContext() | exports | parseCodeContext |
参数 | str(String) | ||
参数 | parentContext(Object=) | An indication if we are already in something. Like a namespace or an inline declaration. | |
返回 | Object | ||
可见度 | public |
Escape the given html
.
方法 | exports.escape() | exports | escape |
参数 | html(String) | ||
返回 | String | ||
可见度 | private |