remark-bemjson

1.0.2 • Public • Published

remark-bemjson

Compile markdown to BEMJSON with remark.

NPM Status Travis Status Coverage Status Dependency Status Greenkeeper badge

Requirements

Install

$ npm install remark-bemjson

Usage

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"
      }
    ]
  }
}

API

remark.use(bemjson[, options])

options

string exportType - determinate how to export bemjson. Default: commonJS
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.
string exportName - export bemjson with given name when use modules, umd or YModules.
boolean export - if false don't generate export. Default: true
Function augment - callback called on every node. Signature. Option passed to mdast-util-to-bemjson.

License

Code and documentation copyright 2017 YANDEX LLC. Code released under the Mozilla Public License 2.0.

Readme

Keywords

Package Sidebar

Install

npm i remark-bemjson

Weekly Downloads

11

Version

1.0.2

License

MPL-2.0

Unpacked Size

27.3 kB

Total Files

8

Last publish

Collaborators

  • birhoff