0.3.0 • Published 7 years ago
babel-plugin-markdown v0.3.0
babel-plugin-markdown
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- 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