postmd

0.0.2 • Public • Published

PostMD

Usage

npm i -S postmd

const PostMD = require('postmd');
const bemjson = require('postmd/plugins/postmd-bemjson');
 
const json = PostMD('I am using __markdown__.', {
    transform: {
        format: 'json', // Default: html
        plugins: bemjson({ scope: 'md' })
    }
});
 
console.log(JSON.stringify(json));
 
// [{"tag":"p","content":["I am using ",{"tag":"strong","content":["markdown"]},"."],"block":"md-paragraph"},"\n"]

PostMD(md, options) ⇒ Object.<{String | PostHTMLTree>

PostMD Options

  • parser - custom mardown parser
  • transform
    • format - result kind: 'html'|'json'
    • plugins<Function|Array> - transform plugins

License MIT

Package Sidebar

Install

npm i postmd

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • verybigman