According to WikiPedia:
Syntax highlighting is a feature of some text editors that display text—especially source code—in different colors and fonts according to the category of terms. This feature eases writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it’s made only for human readers/editors.
SyntaxHighlighter 2.0 is one of the most popular fully functional self-contained code syntax highlighter developed in JavaScript. Alex Gorbatchev started this project in 2004 and since then has gained a lot of acceptance. Version 2.0 comes with a near complete rewrite, clean up, optimization, standard compliance and new features.
Features include:
- Easy to setup
- Over 20 syntax brushes available (PHP, SQL, JavaScript, HTML etc.)
- You can easily change the font size in the highlighted elements without having to mess around with additional CSS.
- Allows you to force highlighted elements on the page to be collapsed by default.
- Allows you to turn detection of links in the highlighted element on and off. If the option is turned off, URLs won’t be clickable.
- Allows you to turn line wrapping feature on and off.
- Source: http://alexgorbatchev.com/wiki/SyntaxHighlighter
- Demos: http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes
- License: LGPL 3
GeSHI is a Generic Syntax Highlighter that aims to be a simple but powerful highlighting class. Initially, it was started as an idea to create a generic syntax highlighter for the phpBB forum system, but has been generalized to this project.
Features include:
- Support for a wide range of popular languages
- Easy to add a new language for highlighting
- Highly customisable output formats
GeSHi aims to do this all as quickly as possible. Many customisable features of GeSHi facilitate speed increases, and you can easily find a balance between the amount of highlighting done and the speed in which it is done.
- Source: http://qbnz.com/highlighter/
- Demo: http://qbnz.com/highlighter/demo.php
- Download: http://sourceforge.net/projects/geshi/files/
- License: GNU GPL
SHJS is a JavaScript application which highlights source code passages in HTML documents. These docs are highlighted on the client side by the web browser. SHJS has the ability to highlight source code written in many different languages since it uses language definitions from GNU Source-highlight.
- Source: http://qbnz.com/highlighter/
- Demo/Documentation: http://shjs.sourceforge.net/doc/documentation.html
- Download: http://shjs.sourceforge.net/doc/download.html
- License: GNU GPL Version 3
JSHighlighter is a JavaScript dedicated Syntax Highlighter. It requires JSL and then it is compatible with all JavaScript 1.2 browser, starting from IE4.
Features include:
- Really fast basic highlight that should be used with some other languages too (ActionScript and maybe others)
- Complete Full Highlight (not fast as basic convertion with old CPUs)
- Compatible with All JS 1.2 or greater browser
- Unobtrusive way to highlight JavaScript Source Code
- Source: http://www.devpro.it/jshighlighter/
- Demo: http://www.devpro.it/jshighlighter/demo.html
- Download: http://www.devpro.it/jshighlighter/download.php
- License: GNU GPL Version 3
Codemirror is an on the fly JavaScript Syntax Highlighting engine that can highlight many different languages (PHP, JavaScript, HTML, CSS etc.).
CodeMirror is a JavaScript library that can be used to create a relatively pleasant editor interface for code-like content ― computer programs, HTML markup, and similar. If a parser has been written for the language you are editing (see below for a list of supported languages), the code will be coloured, and the editor will help you with indentation.
- Source: http://marijn.haverbeke.nl/codemirror/
- Demo: JavaScript | XML/HTML | CSS | SPARQL | HTML mixed-mode
- Documentation: http://marijn.haverbeke.nl/codemirror/manual.html
- License: ZLib-Style
Chili is a fully customizable and fast JQuery Code Highlighter Plugin that comes bundled with recipes for C++, C#, CSS, Delphi, Java, JavaScript, LotusScript, MySQL, PHP, and XHTML.
Features include:
- Supports line numbers
- Renders identically on Internet Explorer, Firefox, Opera, and Safari
- Supports line numbers
- Many configuration options: Static, Dynamic, Automatic, Manual, Ad-Hoc
- The recipe format gives full control on highlighting
- Source: http://noteslog.com/chili/
- Download: http://code.google.com/p/jquery-chili-js/downloads/list
- License: MIT
JUSH is a JavaScript Syntax Highlighter that can be used for client-side syntax highlighting of the following languages: HTML, CSS, JavaScript, PHP, SQL, php.ini and Apache config. The JS highlighter is also available as a JQuery Plugin.
Features include:
- Highlights languages embedded into each other
- Links to documentation of all languages
- Easily color modification using CSS
- Recognizes complete PHP syntax including __halt_compiler, heredoc, backticks, {$} variables inside strings, namespaces