Subscribe in a reader - Subscribe via Email - 1902 Subscribers and Counting!!!

World of information, opinions, cricket and technology.

How to Beautify Code samples in your post using Syntax Highlighter

Tuesday, October 21st, 2008

I was reading Do you need all those revisions? post from Nice2All blog. In the post, i found piece of SQL and PHP code.

Below is the Sample 1, how the code looked in that post:

<script type="text/javascript">
<!--
document.write("<i>Hello World!");
//-->
</script>

As you can see that the coloring, formatting is making the code stand out and there are also options like view plain, copy to clipboard, print.

I think i have around 5 posts that show code samples in the posts and here is how it looks.

Below is the Sample 2:


<script type="text/javascript">
<!–
document.write("<i>Hello World!");
//–>
</script>

I know every one would prefer the Sample 1 rather than the Sample 2.

As soon as i read the above mentioned post, i left a comment asking the author about the code format and found out that it can be done by just installing a wordpress plugin called SyntaxHighlighter Plus.

How to beautify code sample in your post using Syntax Highlighter Plus:

(more…)