1.2.0 • Published 9 years ago

mdast-highlight.js v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

mdast-highlight.js Build Status NPM version Dependency Status

Highlight code blocks in Markdown files with highlight.js.

Install

With npm do:

npm install mdast-highlight.js --save

Example

mdast-highlight.js is designed to work with mdast-html:

var mdast = require('mdast');
var html  = require('mdast-html');
var hljs  = require('mdast-highlight.js');

var markdown = '```css\nh1 {\n    color: red;\n}\n```\n';
var result = mdast.use([ html, hljs ]).process(markdown);
console.log(result);

//=> Compiled HTML with highlighted CSS!

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs