1.0.2 • Published 5 years ago

remark-bemjson v1.0.2

Weekly downloads
12
License
MPL-2.0
Repository
github
Last release
5 years ago

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
ValueDescription
commonJSExports to CJS.
modulesExports to ES6 modules. Optional combines with exportName.
umdExports to UMD with umd package. Requires exportName.
YModulesExports to YModules. Requires exportName.
no exportDon'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.

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.0

6 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago