babel-plugin-markdown

0.3.0 • Public • Published

babel-plugin-markdown

NPM version NPM downloads CircleCI codecov donate

Install

yarn add babel-plugin-markdown --dev

Usage

In .babelrc:

{
  "plugins": ["markdown"]
}

Then you can write:

const html = markdown`
# hello
 
**This is markdown**
`
 
// yield:
 
const html = "<h1>hello</h1><p><strong>This is markdown</strong></p>"

External files

const html = markdown.require('./foo.md')
 
// yield:
 
const html = '<h1>foo</h1>'

Use with options

{
  "plugins": [
    ["markdown", {
      // All markdown-it options
      "html": false,
      // Plus "plugins":
      "plugins": [
        // It loads "markdown-it-task-lists"
        "task-lists"
      ]
    }]
  ]
}

If you want to pass options to a markdown-it plugin, do:

{
  "plugins": [
    ["pluginName", { "anyOptions": true }]
  ]
}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

babel-plugin-markdown © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).

egoistian.com · GitHub @egoist · Twitter @rem_rin_rin

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-markdown

Weekly Downloads

0

Version

0.3.0

License

MIT

Last publish

Collaborators

  • rem