Syntax highlighting in Blogspot

At times you may want to add code in blogspot(http://www.blogger.com). It can be done with the following steps
PS:There are many other similar services.
Google "Syntax highlighting in Blogspot" to get an entire list

Steps

  1. Visit code highlighter : http://ajblk.github.io/SyntaxHighlightGenerator-v3.0/OnlineGenerator.html
Syntax highlighting in Blogspot
Syntax highlighting in Blogspot
  1. Paste the code, select "language" & "code"
  2. Click "Get Formatted HTML"
  3. Preview Code
  4. Add External CSS and JS Library on the begining of the blog
    <script src="http://ajblk.github.io/SyntaxHighlightGenerator-v3.0/scripts/sh-v3.0-min.js" type="text/javascript"></script>
    <link href="http://ajblk.github.io/SyntaxHighlightGenerator-v3.0/styles/shCoreDefault.css" rel="stylesheet" type="text/css">
  5. Add script at the end of blog
    <script type="text/javascript">SyntaxHighlighter.initialize();</script>
  6. Copy generated code in step 3 and paste in blog