Add Syntax Highlighter To Blogger Blogs

by Simrandeep Singh on July 28, 2009

syntax-highlighter-bloggerFew days back I have shared a post about Syntax Highlighter WordPress plugin to beautify your posts on wordpress blog. Now here is tutorial to add the same syntax highlighter to blogger blogs. Simply follow the steps given below :

  1. First of all copy the code given in this link and paste it before </b:skin> tag.
  2. Now paste the followig code before </head> tag
    <!-- Add-in CSS for syntax highlighting -->
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'></script>
    <script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'></script>
  3. Now search for the </body> tag and paste the following code before it :
    <!-- Add-in Script for syntax highlighting -->
    <script language='javascript'>
    dp.SyntaxHighlighter.BloggerMode();
    dp.SyntaxHighlighter.HighlightAll('code');
    </script>
  4. Click on Save Template.
  5. Whenever you have to write some codes in your posts, simply write the codes between the following tags :
    <pre name="code">
    ...Your html-escaped code goes here...
    </pre>

Thanks to Heisencoder for this beautiful coding for blogger blogs

Article by

Simrandeep is the owner and editor-in-chief of TricksDaddy. He is a part-time blogger from India. Catch him on Facebook and Twitter.

Simrandeep has written 527 awesome articles.

{ 14 comments… read them below or add one }

Swagat July 28, 2009 at 12:18 am

that is a valuable post.. Thanks for that.
.-= Swagat´s last blog ..How to add 125×125 ad spots in your template? =-.

Reply

Simran July 28, 2009 at 12:20 am

Thanks Swagat for appreciation :)

Reply

Amal Roy July 28, 2009 at 6:31 am

Nice Find Friend. But adding these many javascripts will certainly make the blog load very slow.It would be best if all the JavaScripts are compressed into one single file. So less requests will be made and blog gets considerably faster. Keep posting.
.-= Amal Roy´s last blog ..How To Avoid Getting Banned on Twitter – 10 Useful Tips =-.

Reply

Tech @ InkAPoint July 29, 2009 at 1:03 am

It will be helpful for my new blog. Thanks dude.
.-= Tech @ InkAPoint´s last blog ..Now Tech @ InkAPoint is Fresh & Fast =-.

Reply

Bariski July 29, 2009 at 10:33 am

This really will come in handy for my coming projects. Thanks muchly. Bookmarked.
.-= Bariski´s last blog ..22 Amazing and Colorful High Speed Photography Shots =-.

Reply

sham July 29, 2009 at 9:39 pm

This plugin does not work properly at times ..I had tough time with it..I have stopped using it..

Reply

crazy blogger July 30, 2009 at 10:48 am

great post about adding highlighter to blogger.

thank you

Reply

qwertyweb.blogspot.com August 1, 2009 at 10:34 am

will come in handy ,but troublesome to add code everytims :P
.-= qwertyweb.blogspot.com´s last blog ..Twitter gets a new homepage =-.

Reply

Piyush Dungrani January 3, 2010 at 9:54 am

Very nice information dude :-) , i am using syntex highlighter right now :-)
.-= Best Blogger Tips´s last blog ..Add DISQUS Comments in Blogger =-.

Reply

Mücahit Özer April 19, 2010 at 8:54 pm

Wawwwwww. Thanks Tricksdaddy. :)
.-= Mücahit Özer´s last blog ..Meb Anket Yapıyor [Okullara Sivil Kıyafetle Girilsin mi ?] =-.

Reply

Mad Geek @beingPC June 27, 2010 at 3:24 pm

Nice way to do without plugin

Reply

Geek Blogger June 28, 2010 at 6:34 am

This is a must need Tips for blogger users. you have done it again mat :)

Reply

sureshpetesrs October 9, 2010 at 5:34 pm

hey is there any plguin for the wordpress??

Reply

Simrandeep October 9, 2010 at 6:56 pm

Leave a Comment

{ 1 trackback }

Previous post:

Next post:

© 2008-2011 TricksDaddy. All Rights Reserved | Privacy Policy | Sitemap | Designed by Simrandeep Singh