md-hl-loader
v1.1.1
Published
markdown-it + highlight
Downloads
8
Maintainers
Readme
md-hl-loader
Markdown + Highlight.js => HTML
Install
npm install md-hl-loader -D
Configuration
webpack basic
// ...
rules: [
{
test: /\.md$/,
loader: 'md-hl-loader'
}
]
// ...
with options
// ...
rules: [
{
test: /\.md$/,
loader: 'md-hl-loader',
// https://github.com/markdown-it/markdown-it#init-with-presets-and-options
options: {
markdownItOptions: {
html: true
},
compileImages: true // compile images
}
}
]
// ...
Usage
article.md
# Test
app.js
import article from './article.md'
import 'highlight.js/styles/github.css'
console.log(article) // '<h1>Test</h1>'