react-native-web-headroom
Version:
React Native Web Headroom
80 lines (63 loc) • 2.27 kB
Markdown
markdown-loader
===============
markdown-loader for webpack using [marked](https://github.com/chjj/marked).
[](https://www.npmjs.com/package/markdown-loader)
[](https://www.npmjs.com/package/markdown-loader)
[](https://david-dm.org/peerigon/markdown-loader)
[](https://travis-ci.org/peerigon/markdown-loader)
`npm install markdown-loader`
Since marked's output is HTML, it's best served in conjunction with the [html-loader](https://github.com/webpack/html-loader).
```javascript
{
module: {
rules: [{
test: /\.md$/,
use: [
{
loader: "html-loader"
},
{
loader: "markdown-loader",
options: {
/* your options here */
}
}
]
}]
}
}
```
Simply pass your marked [options](https://github.com/chjj/marked#options-1) as shown above.
In order to specify [custom renderers](https://github.com/peerigon/markdown-loader/issues/5), simply set the `options.renderer`-option on your webpack options.
```javascript
// webpack.config.js
const marked = require("marked");
const renderer = new marked.Renderer();
return {
module: {
rules: [{
test: /\.md$/,
use: [
{
loader: "html-loader"
},
{
loader: "markdown-loader",
options: {
pedantic: true,
renderer
}
}
]
}]
}
}
```
MIT (http://www.opensource.org/licenses/mit-license.php)
[<img src="https://assets.peerigon.com/peerigon/logo/peerigon-logo-flat-spinat.png" width="150" />](https://peerigon.com)