0.0.2 • Published 6 years ago

postmd v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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