Lloyd Brookes cc81057ae3 docs
2016-08-06 13:29:20 +01:00

4.6 KiB

jsdoc-to-markdown

Example

const jsdoc2md = require('jsdoc-to-markdown')

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