Thursday, March 05, 2009

Highlight Your Codes With SyntaxHighlighter

Syntax Highlighter
Remember using line numbers when coding in GW-BASIC? Well, although the days of GW-BASIC is long gone, you can still use line numbers to highlight the codes you publish on your blog/site. Advantage : readability.

To easily highlight your codes you can use SyntaxHighlighter. SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript. SyntaxHighlighter runs in the browser, in other words it doesn't really matter what kind of server you have. In fact, SyntaxHighlighter can run locally on your computer without any web server at all and best of all it runs in virtually every modern web browser.

SyntaxHighlighter 2.0, which is the latest version available, uses separate syntax files called brushes to define its highlighting functionality. Currently brushes are available for Bash/shell, C#, C++, CSS, Delphi, Diff, Groovy, JavaScript, Java, Perl, PHP, Plain Text, Python, Ruby, Scala, SQL, Visual Basic and XML. In case you don't see the brush for the language you are working with, you can request for a brush in their forums, or you can create it yourself.

SyntaxHighlighter is licenced under LGPL3 and is a Donationware. If you plan to use it, please donate. It would help the authors to keep the project running.

If you liked this post, consider subscribing to RSS feed of The Chronicles of R.

0 Comment:

Post a Comment

Blog comment guideline