jsdoc-with-markdown
v2.0.1
Published
Parses JSDoc-like string into JSON assuming the formating is in Markdown.
Downloads
4
Maintainers
Readme
jsdoc-with-markdown
Parses JSDoc-like string into JSON assuming the formating is in Markdown. You can use babel-extract-comments to extract comments from JavaScript source.
Installation
npm instal --save-dev jsdoc-with-markdown
Usage
import parseJSDocComments from 'parse-jsdoc-comments';
parseJSDocComments(
* This is a description.
*
* ## Example
*
* ```js
* function hello() {
* console.log('Hi!');
* }
* ```
);
// [
// {
// "type": "paragraph",
// "value": "<p>This is a description.</p>\n"
// },
// {
// "type": "paragraph",
// "value": "<h2>Example</h2>\n"
// },
// {
// "type": "code",
// "value": "<pre><code class=\"language-js\">function hello() {\n console.log('Hi!');\n}\n</code></pre>\n"
// }
// ]
License
ISC