Remarkable loader for webpack
Parses source as Markdown using the awesome Remarkable parser.
Installation
$ npm install --save remarkablejs-loader
Usage
In your webpack.config.js
file:
module.exports = {
module: {
loaders: [{
test: /\.md/,
loader: 'remarkablejs-loader',
options:{
loader: 'remarkablejs-loader',
options: {
html: true,
xhtmlOut: true,
breaks: true,
langPrefix: 'hljs ',
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
} catch (err) {
}
}
try {
return hljs.highlightAuto(str).value;
} catch (err) {
}
return ''; // use external default escaping
}
},
plugins:[function (md) {
md.renderer.rules.table_open = function(){
return `<div style="overflow: auto;"><table
class="table table-striped table-bordered table-condensed table-hover"
style="white-space:nowrap;">`;
};
md.renderer.rules.table_close =function() {
return `</table></div>`;
};
}]
}
}]
}
};
Meta
- Code:
git clone git://github.com/unindented/remarkable-loader.git
- Home: https://github.com/unindented/remarkable-loader/
Contributors
- Daniel Perez Alvarez (unindented@gmail.com)
License
Copyright (c) 2014 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.