0.1.0 • Published 8 years ago

remark-yaml-meta v0.1.0

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

remark-yaml-meta

Extract YAML front-matter from markdown.

Installation

npm:

npm install remark-yaml-meta

Usage

Dependencies:

var remark = require('remark');
var metaPlugin = require('remark-yaml-meta');

Process:

var file = remark().use(metaPlugin).process([
    '---',
    'foo:',
    '  bar: true',
    '---',
    ''
].join('\n'));

Yields:

{
  "foo": {
    "bar": true
  }
}

API

remark.use(yamlConfig)

Passes the configuration at the remark field as parse and stringify settings.

Just like remark-yaml-config, but the parsed object is saved to the meta property of the retuned VFile.

License

MIT © Chris Gomez