Skip to content

Instantly share code, notes, and snippets.

@gnab
Created December 11, 2013 18:34
Show Gist options
  • Save gnab/7915894 to your computer and use it in GitHub Desktop.
Save gnab/7915894 to your computer and use it in GitHub Desktop.
Syntax highlighting Markdown code blocks with Harp.
require('harp').server(__dirname + '/public', { port: process.env.PORT || 5000 });
var marked = require('./node_modules/harp/node_modules/terraform/node_modules/marked');
var highlight = require('highlight.js');
marked.setOptions({
langPrefix: '',
highlight: function (code, language) {
if (language) {
return highlight.highlight(language, code).value;
}
return code;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment