
jQuery.Syntax is an extremely fast and lightweight syntax highlighter written in JavaScript. It has dynamic loading of syntax source files and integrates cleanly using CSS or modelines.
// -*- mode: javascript; -*-
var foo = function () {
alert("Hello World");
}
for (var i = 0; i < 100; i += 1) {
foo();
}
jQuery.Syntax also does inline syntax highlighting for all supported languages. For example: @x = y + 10 (Ruby) and <img src="logo.png" /> (HTML)! Try it online now!
Documentation
jQuery.Syntax is available to be installed directly into your website, or as a plugin to several open source content management systems.
- Supported Languages & Examples [Layout Examples]
- Installation Instructions [Advanced Setup]
- How to use modelines
- How to contribute
Compatibility
jQuery.Syntax has been developed with maximum compatibility in mind, and supports a wide range of web browsers. We are always testing with new browsers, so please let us know if you don't see your browser listed.
| Browser | Supported Versions | Notes |
|---|---|---|
| Firefox | 2+ | Complete Support. |
| Safari | 3+ | Complete Support. |
| Opera | 9+ | Complete Support. |
| Internet Exploder | 6+ | Minor bugs in IE6. |
Download

jQuery.Syntax is available freely under the AGPLv3 license.
- jQuery.Syntax Prepackaged Source Code & Stylesheets
- jQuery 1.4.1+ JavaScript Framework (Required)
Source code is available at GitHub.
Plugins
- DokuWiki Plugin Download [DokuWiki Plugin Page]
- WordPress Plugin Download [Install Instructions | WordPress Plugin Page]
Changelog
- Release 2.3 (2010-06-17)
- Major rework of whitespace handling and improvements to layouts.
- Release 2.2
- Minor bug fixes, several new brushes (Lua, C#, Perl5, etc) and layouts.
- Release 1.9
- Minor bug fixes, added new brush (Java), released updated DokuWiki and WordPress plugins.
- Release 1.8 (2010-04-23)
- Minor bug fixes, added shorthand notation, added new brush (YAML), simplified setup and usage.
- Release 1.5 (2010-04-09)
- Minor bug fixes, optimizations, and several new brushes (SQL and Basic).
Free Software License
The "jQuery.Syntax" project is licensed under the GNU AGPLv3.
Copyright 2010 Samuel Williams. All rights reserved.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
"Additional permissions" (as per Section 7 of the AGPLv3)
- Any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes.
- You may distribute non-source (e.g., minimized or compacted) forms of the code without the copy of the GNU AGPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source.
If you modify this code, you must include these "Additional permissions" in your version of the code.
Commercial License
Orion Transfer Ltd sells commercial licenses for jQuery.Syntax, which include installation, customization and support. Please contact us for more details.
Donations
jQuery.Syntax is released under a free software license. If you find this software useful, please consider donating.
Credits
I, Samuel Williams, developed the majority of this code. I was helped by a number of kind people on IRC when banging my head against bugs in Internet Explorer, and other such issues. Thanks to everyone who helped.
Thanks to The jQuery Project for providing such a wonderful framework. It is easy to work with and makes life much easier when dealing with cross-browser issues.
Thanks to Alex Gorbatchev whose SyntaxHighlighter project provided a lot of ideas and inspired me to work hard. I think he has contributed a great deal to the community.
Thanks to Tadao Takaoka, my wise sensei, who has listened to me talk about algorithms for countless hours. jQuery.Syntax has a number of interesting and unique algorithms to solve highlighting problems efficiently. jQuery.Syntax is extremely fast because he helped me to think about the problem in new ways.
