Saturday, September 27, 2008

Syntax Highlight/Format C#, Java, PHP Code in Blogger

The method I used to put syntax highlighted code in my blog is to use the "Code Format" tool provided by Manoli.net. It works fine but I am just lazy to convert my code every time I post a new entry.

I then try to find another solution. One option is to use SyntaxHighlighter, a Java Script library that does all the syntax highlight jobs for you.

After installation, one problem I faced is that all the "new line" I wrote in "Edit Html" of Compose Page in Blogger are converted to "
". That's not very nice : (

Like everytime, I performed a search and found a good solution here, Using SyntaxHighlighter on BLOGGER. The purpose of additional script is to convert all the "
" found in the code to "new line" chracter. It works fine and here is my sample of highlighted Java code.

(Of course, I will not use silly program like Hello World for this :D )

And here is the result:



Simple, isn't it ?

3 comments:

Andria BZ said...

Great Post, Actually PHP is a beautiful source for developing a database driven web application, I love this post, thanks for spending your time for discussing about this topic.
PHP Course in Chennai

Amirtha rao said...


This technical post helps me to improve my skills set, thanks for this wonder post I expect your upcoming blog, so keep sharing..
Regards,
Web designing course in chennai|Web design training in chennai

dev2one said...



PHP or Hypertext Preprocessor is the most preferred programming language in the world, used for dynamic website
development and web based applications. This server side scripting language has been used to develop some of the
most popular website such as Facebook and Wikipedia.
php