It seemed like a reasonable expection to be able to post snippets of code in a blog post. But alas it is not a straight forward task. After a bit of research the leading option appears to be SyntaxHighlighter by Alex Gorbatchev. While there are a number of articles which describe the installation and configuration of SyntaxHighligher here are the steps I took. Your mileage may vary, and I would recommend reading the post by Zobayer Hasan and Bloggermint.



In order to avoid the need to host the files yourself, I would suggest using files hosted by Alex Gorbatchev. Go to Dashboard ⇒ Layout ⇒ Edit Html and find the tag in your template. It will be near the top of the file.

<head>

Paste the following code after the <head> tag and press the Save Template button.

<!-- SyntaxHighlighter core js files -->
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>

<!-- SyntaxHighlighter brushes -->
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'/>

<!-- SyntaxHighlighter core style -->
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
 
<!-- SyntaxHighlighter theme -->
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>

<!-- SyntaxHighlighter main js -->
<script type='text/javascript'>
  SyntaxHighlighter.config.bloggerMode = true;
  SyntaxHighlighter.defaults['auto-links'] = true;
  SyntaxHighlighter.defaults['toolbar'] = false;
  SyntaxHighlighter.all()
</script>