remark-yaml-config
remark plugin to configure it with YAML frontmatter
Last updated 2 months ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install remark-yaml-config 
SYNC missed versions from official npm registry.

remark-yaml-config

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to configure it with YAML frontmatter. This requires remark-frontmatter as well.

Install

npm:

npm install remark-yaml-config

Use

Say we have the following file, example.md:

---
remark:
  commonmark: true
  bullet: "*"
---

1)  Commonmark list (this is a parse setting)

*   Hello (this is a stringify setting)

And our script, example.js, looks as follows:

var vfile = require('to-vfile')
var remark = require('remark')
var frontmatter = require('remark-frontmatter')
var yamlConfig = require('remark-yaml-config')

remark()
  .use(frontmatter)
  .use(yamlConfig)
  .process(vfile.readSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

---
remark:
  commonmark: true
  bullet: "*"
---

1.  Commonmark list (this is a parse setting)

*   Hello (this is a stringify setting)

API

remark().use(yamlConfig)

Plugin to configure the processor with YAML frontmatter. Takes the 'remark' field in the frontmatter and passes it as configuration to parse and stringify.

Just like remark-comment-config, but YAML is more visible.

Security

Use of remark-yaml-config can change how Markdown is parsed or compiled. If the Markdown is user provided, this may open you up to a cross-site scripting (XSS) attack.

Related

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Current Tags

  • 4.1.1                                ...           latest (2 months ago)
  • 3.0.0-alpha.1                                ...           next (4 years ago)

13 Versions

  • 4.1.1                                ...           2 months ago
  • 4.1.0                                ...           a year ago
  • 4.0.3                                ...           2 years ago
  • 4.0.2                                ...           2 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.0.2                                ...           4 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 3.0.0-alpha.1                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |