I'm writing blog posts for my company blog and I would like code snippets to show up with syntax highlighting.
All 开发者_如何学运维I can do is write html/css.
Is there any app/webapp that will let me paste in a c++ code snippet and get a chunk of html with the highlighting?
Try this Online syntax highlighting Site, and especially the C++ section.
You paste in your code and it does the hard work.
I use emacs M-Xhtmlize-bufferRET. Also enscript is very powerful to generate colorized HTML from many source code formats.
For others looking for a solution to this problem - you should checkout:
http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html
It's a really easy "SyntaxHighlighter for Blogger" tutorial with screenshots and everything.
You should be up and running in only a few minutes.
Also, for your C++ application, make sure you have the shBrushCpp.js library referenced in your <head></head> section like this:
<head>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
</head>
Have a look at http://www.syntaxhighlight.com - supporting 222 languages. Paste your code and get the formatted html.
精彩评论