Syntax Highlighting with Blogger Engine

I’ve been using Blogger as my blogging engine for a couple of weeks. I’ve been quite impressed at how easy it makes it to update your blogs look and feel and how free you are with the HTML and semantic layout of the pages.
One thing that seemed to be missing was allowing developers to copy and paste code into their blogs and allow other users to copy and paste the code from the blog into their own code.


Using SyntaxHighlighter Javascript Library

So in my search to find something better i came across this post which uses syntax highlighter.


Adding Syntax Highlighter to Blogger Template

  • Copy the following code

 















  • paste it into your Blogger Template inside </head> tag
  • Save the template
  • now start creating code blocks in your existing or new Blog entries.
  • There are 2 ways to add a code block using syntaxhighlighter

Using the Script tag


Using the Pre tag

// Comment
public class Testing {
public Testing() {
}

public void Method() {
/* Another Comment
on multiple lines */
int x = 9;
}
}
Guys, don’t get irritated it might not work in post preview. So, please publish your blog and then test this code.

@AskmeSiebel

Thanks for subscribing to SimplySiebel.

Leave a Reply

Your email address will not be published. Required fields are marked *