Precompile markdown to HTML at build time.
MIT License
yarn add babel-plugin-markdown --dev
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>"
const html = markdown.require('./foo.md')
// yield:
const html = '<h1>foo</h1>'
{
"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 }]
]
}
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
babel-plugin-markdown © egoist, Released under the MIT License. Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @_egoistlily