Configure remark with YAML front-matter.
Installation
npm
npm install remark-yaml-config
remark-yaml-config is also available for duo,
and as an AMD, CommonJS, and globals module, uncompressed and
compressed.
Table of Contents
Usage
var yamlConfig = require('remark-yaml-config');
var remark = require('remark').use(yamlConfig);
var input = [
'---',
'remark:',
' commonmark: true',
' bullet: "*"',
'---',
'',
'1) Commonmark list (this is a parse setting)',
'',
'- Hello (this is a stringification setting)',
''
].join('\n');
var tree = remark.parse(input);
Stringifying the document yields:
var doc = remark.stringify(tree);
---
remark:
commonmark: true
bullet: '*'
---
1. Commonmark list (this is a parse setting)
* Hello (this is a stringification setting)
API
Passes the configuration
found in YAML front-matter (under the remark
key) to remark.
This is especially useful if you’re using remark’s CLI,
which allows multiple documents to be processed in one go, but you’d like
certain files to have different formatting.
Signatures
remark = remark.use(yamlConfig, options?)
.
Parameters
yamlConfig
— This plugin;options
(Object?
) — Passed to remark-yaml.
License
MIT © Titus Wormer