4.6 KiB
jsdoc-to-markdown
Example
const jsdoc2md = require('jsdoc-to-markdown')
- jsdoc-to-markdown
- .clear() ⇒
Promise - async
- .render(src, [options]) ⇒
Promise - .getTemplateData(src, [options]) ⇒
Promise - .getJsdocData(src, [options]) ⇒
Promise
- .render(src, [options]) ⇒
- sync
- .renderSync(src, [options]) ⇒
string - .getTemplateDataSync(src, [options]) ⇒
Array.<object> - .getJsdocDataSync(src, [options]) ⇒
Array.<object>
- .renderSync(src, [options]) ⇒
- .clear() ⇒
jsdoc2md.clear() ⇒ Promise
Clear the cache.
Kind: static method of jsdoc-to-markdown
jsdoc2md.render(src, [options]) ⇒ Promise
Returns markdown documentation from jsdoc-annoted source code.
Kind: static method of jsdoc-to-markdown
Category: async
Fulfil: string - the rendered docs
| Param | Type | Description |
|---|---|---|
| src | string | Array.<string> |
input files |
| [options] | object |
the options |
Example
Pass in filepaths (** glob matching supported) of javascript source files:
> jsdoc2md.render('lib/*.js').then(console.log)
jsdoc2md.getTemplateData(src, [options]) ⇒ Promise
Get the template data (jsdoc-parse output)
Kind: static method of jsdoc-to-markdown
Category: async
Fulfil: object[]
| Param | Type | Description |
|---|---|---|
| src | string | Array.<string> |
input files |
| [options] | object |
|
| [options.sort-by] | string | Array.<string> |
Sort by one of more properties, e.g. [ 'kind', 'category' ]. |
jsdoc2md.getJsdocData(src, [options]) ⇒ Promise
Get the jsdoc data (jsdoc-api explain output)
Kind: static method of jsdoc-to-markdown
Category: async
Fulfil: object[]
| Param | Type | Description |
|---|---|---|
| src | string | Array.<string> |
input files |
| [options] | object |
jsdoc2md.renderSync(src, [options]) ⇒ string
Returns markdown documentation from jsdoc-annoted source code.
Kind: static method of jsdoc-to-markdown
Category: sync
Engine: nodejs >= 0.12
| Param | Type | Description |
|---|---|---|
| src | string | Array.<string> |
input files |
| [options] | object |
the options |
Example
const docs = jsdoc2md.renderSync('lib/*.js')
jsdoc2md.getTemplateDataSync(src, [options]) ⇒ Array.<object>
Get the template data (jsdoc-parse output)
Kind: static method of jsdoc-to-markdown
Category: sync
Engine: nodejs >= 0.12
| Param | Type | Description |
|---|---|---|
| src | string | Array.<string> |
input files |
| [options] | object |
|
| [options.sort-by] | string | Array.<string> |
Sort by one of more properties, e.g. [ 'kind', 'category' ]. |
jsdoc2md.getJsdocDataSync(src, [options]) ⇒ Array.<object>
Get the jsdoc data (jsdoc-api explain output)
Kind: static method of jsdoc-to-markdown
Category: sync
Engine: nodejs >= 0.12
| Param | Type | Description |
|---|---|---|
| src | string | Array.<string> |
input files |
| [options] | object |