Article Diary - General Knowledge Digest

13 Useful Javascript Syntax Highlighting Scripts

A Syntax Highlighter allows you to easily post syntax-highlighted source code to your site without loosing it’s formatting or making any manual changes. Syntax highlighting is very important especially when we want to show our code example on the blog. By enabling the syntax highlighting on your blog, readers can read the code blocks easier.

Why Use Syntax Highlighting?

Syntax HighlightingWhen sharing codes on a website, even they are wrapped with tags or styled differently, it is always a challenge to read them without syntax highlighting. There are various syntax highlighters which can format the codes & color them appropriately according to the languages used. Whether it is a HTML page or runs on PHP, Ruby, Python, ASP, there is a suitable syntax highlighter. Here is a collection of 13 syntax highlighter scripts to beautify code presentation on the web. There are a lot of free and useful syntax highlighting scripts around us. Most of the scripts are written using Javascripts, though some of them are powered by other programming languages such as Phyton or Ruby.

GeSHi (Generic Syntax Highlighter - With PHP)

GeSHi is a powerful syntax highlighter script that supports almost every language. GeSHi features XHTML compliant output with CSS. It was first created for phpBB forum software but became a project itself. It requires PHP to run however there is a hack to make it work under ASP as well.

SyntaxHighlighter (With JS)

This is a flexible & extensible syntax highlighter built with JavaScript. It supports a wide range of languages from CSS to PHP or C++ to SQL. Syntax Highlighter offers ready-to-use themes an new ones can be created easily for a custom presentation. It has support for 3rd party applications like Blogger, Wordpress, Joomla & many others.

Google Code Prettify (With JS)

This is the script used by the Google Code website. The script auto-detects the language used and highlights the code accordingly. It is also customizable via CSS. There is also an AS3 port to this code highlighting script named as3syntaxhighlight.

Highlight.js (With JS)

Highlight.js is very easy to use because it works automatically: finds blocks of code, detects a language, highlights it. It has support for 3rd party applications and provides a Firefox extension for viewing code that doesn’t have syntax highlighting.

SHJS - Syntax Highlighting in JavaScript (With JS)

SHJS uses language definitions from GNU Source-highlight. This gives SHJS the ability to highlight source code written in many different languages.

Chili (With jQuery)

Chili is a code higlighter plugin for jQuery. It works very fast & can be totally customized. It comes bundled with support for popular languages & the download package has examples on usage.

beautyOfCode (With jQuery)

This jQuery syntax highlighter plugin uses Alex Gorbatchev’s SyntaxHighlighter but with a twist: produces more xhtml-compliant codes.

Lighter.js (With MooTools)

Lighter.js is a MooTools-based code highlighter that can create outputs in various formats like ordered lists and tables. It has a GeSHi-like class naming & requires MooTools 1.2.1+

DlHighlight

DlHighlight is a simple syntax highlighting scripts that supports only 4 programming languages: JavaScript, CSS, XML, HTML.

ColourCode (With Ruby)

ColourCode is written in Ruby. It can read a source file and generate a syntax highlighted version in various formats.

Ultraviolet (With Ruby)

Ultraviolet is a syntax highlighting engine that runs on Ruby. It has support for 50+ languages & 20+ themes.

Pygments (With Python)

It is a syntax highlighter that is built with Python. Pygments supports a wide range of languages, various output formats & it is usable as a command-line tool or as a library.

JUSH (jQuery syntax highlighting)

JUSH is yet another jQuery syntax highlighting plugin which supports different programming languages such as HTML, CSS, PHP, PY and SQL.
Attached Files
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code
Related Articles RSS Feed
How to prevent access to a specific file on server using htaccess?
Viewed 807 times since Sun, Mar 14, 2010
Best Free Web Icons for Different Purposes
Viewed 870 times since Mon, Dec 28, 2009
PHP Quiz Questions and Answers
Viewed 2265 times since Mon, Jan 11, 2010
jCart - Free PHP AJAX Shopping Cart
Viewed 1050 times since Sun, Jan 3, 2010
Create Navigation Menu Easily with jQuery Menu
Viewed 848 times since Thu, Dec 31, 2009
jQuery Slider from a Select Element
Viewed 1982 times since Thu, Jan 14, 2010
Create Glowing, Radioactive Buttons with CSS
Viewed 763 times since Sun, Dec 27, 2009
ZeusCart | Feature Rich Open Source E-Commerce System
Viewed 1120 times since Thu, Jul 15, 2010
Create Full Screen Slideshows With Supersized
Viewed 791 times since Tue, Jan 5, 2010
mbSlider - Highly Customizable Content Slider
Viewed 810 times since Mon, Jul 26, 2010
MENU