【问题标题】:Converting blocks of code (C/Python/BASH/etc) to syntax-highlit HTML将代码块 (C/Python/BASH/etc) 转换为语法高亮的 HTML
【发布时间】:2014-04-10 18:27:58
【问题描述】:
【问题讨论】:
标签:
html
syntax-highlighting
atom-editor
【解决方案1】:
我注意到您已经找到了自己的答案,但我认为有更多选择很好,所以这里有另一个:
Stack Exchange 使用这个http://google-code-prettify.googlecode.com/svn/trunk/README.html
活生生的例子(观看它的工作):
exports.create = function(req, res) {
var article = new Article(req.body);
article.user = req.user;
article.save(function(err) {
if (err) {
return res.send('users/signup', {
errors: err.errors,
article: article
});
} else {
res.jsonp(article);
}
});
};
到底有多漂亮?当然取决于你的实现;)