Compile markdown to BEMJSON with remark.
$ npm install remark-bemjson
const remark = require('remark');
const bemjson = require('remark-bemjson');
const file = remark().use(bemjson).processSync('# Hello im _heading_');
console.log(String(file));
Yields:
{
"block": "documentation",
"content": {
"block": "heading",
"mods": {
"level": 1
},
"content": [
"Hello im ",
{
"block": "emphasis",
"content": "heading"
}
]
}
}
Value | Description |
---|---|
commonJS |
Exports to CJS. |
modules |
Exports to ES6 modules. Optional combines with exportName . |
umd |
Exports to UMD with umd package. Requires exportName. |
YModules |
Exports to YModules. Requires exportName. |
no export |
Don't do any export. Just plain JSON.stringify . |
Function augment - callback called on every node. Signature. Option passed to mdast-util-to-bemjson
.
Code and documentation copyright 2017 YANDEX LLC. Code released under the Mozilla Public License 2.0.