Google Code Prettifier

Google released a client-side code prettifier. What you do is include their JavaScript and CSS files in your HTML page, trigger execution with an onload="prettyPrint()” event, and then find everything in your <pre class="prettyprint">...</pre> elements be nicely colored. According to its author Mike Samuel: “It should work on a number of languages including C and friends, Java, […]

Google released a client-side code prettifier. What you do is include their JavaScript and CSS files in your HTML page, trigger execution with an onload="prettyPrint()” event, and then find everything in your <pre class="prettyprint">...</pre> elements be nicely colored.

According to its author Mike Samuel: “It should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk and a decent subset of Perl, but, because of commenting conventions, doesn’t work on Smalltalk, Lisp-like, or CAML-like languages.”

FAQ | Example | Download

Google Code’s featured projects | Google blogoscoped

Google, Google Code Prettifier, Code, CSS, HTML, Java, JavaScript

About The Author

Deepak Gupta is a IT & Web Consultant. He is the founder and CEO of diTii.com & DIT Technologies, where he's engaged in providing Technology Consultancy, Design and Development of Desktop, Web and Mobile applications using various tools and softwares. Sign-up for the Email for daily updates. Google+ Profile.