My blog is hosted on Blogger and I frequently post code snippets in C
/ C#
/ Java
/ XML
etc. but I find the snippet gets "mangled".
Are there any web sites that I could use to parse the snippet beforehand and sort out the formatting, convert XML "<
" to "<
" etc.
There are a numbers of questions around this area on SO but I couldn't find any that address this question directly.
Edit:
For @Rich answer, site states "To display the formatted code on your site, you need to get this CSS stylesheet, and add a reference to it in the <head>
section of your page". That's the problem - you can't do this on Blogger AFAIK.
Method 1: Add code box using HTML code Step-1: Copy the below code and paste it into the HTML section in the Blog post editor of Blogger. Step-2: Now Switch the editor to compose view and replace the text with the code and save the draft as shown in the below screenshot.
I've created a blog post entry which explains how to add code syntax highlighting to blogger using the syntaxhighlighter 2.0
Here's my blog post:
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html
I hope it helps you guys.. I'm quite impressed with what it can do.
Above Links stopped working. Try using http://hilite.me/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With