jsdoc2vuepress
v1.1.12
Published
Simple jsdoc2md wrapper to create ready to use markdown files for vuepress
Downloads
27
Maintainers
Readme
jsdoc2vuepress
TL;DR
If you use JSDoc annotations and Vuepress to generate your docs, this is for you.
About
jsdoc2vuepress will read your library's JSDoc annotations and generate the necessary markdown data to work in vuepress. It will also make Vuepress flowchart plugin annotations work and create a coverage report to easily add it to your docs.
jsdoc2vuepress is simple wrapper for JSDoc2MD, with some changes:
- Instead of using the method's signature as the "title" it will "demote" it to a simple paragraph (italics) and the name of the function is used as the title. This will avoid having long titles in the table of contents / sidebar menu.
- The output is modified so
**Flowstart**:
is changed back into a vuepress-flowchart-plugin compatible version (@flowstart
). Same thing forFlowend
. - The defaults are compatible with yalt4node project (still private, soon will be public)
Usage
jsdoc2vuepres
=> will use default values ('src/*.{js,ts}'
and 'dist/DOCS.md'
)
jsdoc2vuepres 'src/*.{js,ts}'
=> will use default output value ('dist/DOCS.md'
)
jsdoc2vuepres 'src/index.{js,ts}'
=> will use default output value ('dist/DOCS.md'
)
jsdoc2vuepres 'src/index.{js,ts}' 'output'
=> will use ('out/DOCS.md'
)
Note: If you installed this as a local dependency (not globally) you'll need to provide the full "relative" path like this: ./node_modules/.bin/jsdoc2vuepress
References
- JSDocs: https://jsdoc.app
- Vuepress: https://vuepress.vuejs.org
- Vuepress flowchart plugin: https://github.com/ulivz/vuepress-plugin-flowchart
- yalt4node: https://github.com/nriesco/yalt4node
- JSDoc2MD: https://github.com/jsdoc2md/jsdoc-to-markdown
Example
Using this input:
/**
* A quite wonderful function.
* @param {object} - Privacy gown
* @param {object} - Security
* @returns {survival}
*/
function protection (cloak, dagger) {}
JSDoc2MD generates this MD:
## protection(cloak, dagger) ⇒ <code>survival</code>
A quite wonderful function.
**Kind**: global function
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| cloak | <code>object</code> | Privacy gown |
| dagger | <code>object</code> | Security |
and jsdoc2vuepress generates this one (the signature is no longer a header)
## protection
_protection(cloak, dagger) ⇒ <code>survival</code>_
A quite wonderful function.
**Kind**: global function
| Param | Type | Description |
| ------ | ------------------- | ------------ |
| cloak | <code>object</code> | Privacy gown |
| dagger | <code>object</code> | Security |