Syntax Highlighter |
So give it a try if you want to, but before that:-
Step-wise Tutorial on How to Add Syntax Highlighter in Blogger Blog
Step 1 : Go to Blogger Dashboard
Step 2 : Click on Template
Step 3 : Click on Edit HTML
Step 4 : Now press Ctrl + F and find </head>, Paste the following code before </head> tag.
<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>
Step 5 : Now press Ctrl + F and find </body> and paste the following code before </body> tag.
<script language='javascript'> dp.SyntaxHighlighter.BloggerMode(); dp.SyntaxHighlighter.HighlightAll('code'); </script>
Step 6 : Now click on Save Template
Step 7 : Copy the all CSS given in this link
Step 8 : Now go to Template >> Click on Customize >> Click on Advanced >>
Now scroll down and click on Add CSS >> Now paste the code into the box
Step 9 : Click on Apply to Blog
You can start using Syntax Highlighting, just use it with <pre></pre> tag.
<pre name="code" class="css">
---your code goes here---
</pre>
Example:
<pre name="code" class="css">
background: none;
border: none;
padding: 0;
margin: 0;
border: none;
padding: 0;
margin: 0;
</pre>
Note 1 : You should escape your code before using Quick Escape Tool
Note 2 : List of supported language and their alises for <class> attribute.
I hope you will easily set up the Syntax Highlighter in your Blogger Blog. If you still get stuck at any point of time, feel free to contact me.
Happy Blogging!!!
I hope you will easily set up the Syntax Highlighter in your Blogger Blog. If you still get stuck at any point of time, feel free to contact me.
Happy Blogging!!!