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 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 ?


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..
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.

kovalan Jayamurugan said...

I agree with your thoughts!!! As the demand of java programming application keeps on increasing, there is massive demand for java professionals in software development industries. Thus, taking training will assist students to be skilled java developers in leading MNCs. J2EE Training in Chennai | JAVA Training Institutes in Chennai

Harshita said...

Thank you for this informative post. We provide JAVA training in Chennai for students interested in JAVA training in Chennai. So any aspiring students to join JAVA training in Chennai can contact us.

jhansi joe said...

The information you have given here is truly helpful to me. CCNA- It’s a certification program based on routing & switching for starting level network engineers that helps improve your investment in knowledge of networking & increase the value of employer’s network, so if you have an wish to take training on CCNA.
ccna course in Chennai|ccna training in Chennai|ccna training institute in Chennai

Rahul said...

Hello Admin, thank you for the informative post. At Fita academy, we provide the best IT trainings for various courses. You can check our Fita reviews page to know more about our quality and standards.

Raghu Sharma said...
This comment has been removed by the author.
Raghu Sharma said...

Hello, I'am running a PHP training center in Chennai, I found this post very useful and i have gained some extra knowledge which helped me and my students. Keep educating and keep sharing
Raghu Sharma.