Chili – The jQuery Plugin for Highlighting Code
I’ve setup a GitHub account for Chili, so that anyone interested in forging the NEXT version can easily join and contribute.
I’m still new to git, but I hope I have prepared a usable setup for development.
What follows is version 2.2 content. It’s a bit outdated, but still useful. (to be updated)
Main links
- Chili 2.0 Release Post
- Google Code project page
- Quick Start Guide (with examples)
Features
- Very fast highlighting, trivial setup, fully customizable, thoroughly documented, and MIT licensed
- Renders identically on IE, Firefox, Mozilla, Opera, and Safari
- Comes bundled with recipes for C++, C#, CSS, Delphi, Java, JavaScript, LotusScript, MySQL, PHP, and XHTML
- Many configuration options: Static, Dynamic, Automatic, Manual, Ad-Hoc, with Metaobjects.
- Provides fine control over which elements get highlighted by means of a jQuery selector or the mithical jQuery chainability.
- Fully supports javascript regular expressions, including backreferences
- The replacement format gives full control on what HTML is used for highlighting
- Provides examples which show setups and features
Reviews
- Chili, resaltador de sintaxis – Scriptia
- webdev – Testing Enzymes & Chili
- jQuery – Syntax Highlighting
- bassistance.de » Plugin Parade #4: Chili
- Jetlogs.org » Syntax Highlightling with Chili
- Javascript Code Highlighter: Chili vs SyntaxHighlighter :: PseudoCoder.com
- ¿Sabes cómo se hace?: ¿Resaltar sintaxis de codigo en mi pagina o blog?
- Chili – コードãƒã‚¤ãƒ©ã‚¤ãƒˆJavascript | Takazudo Clipping*
- Beautify your blog’s code samples with these syntax highlighters
@Jessica I’m surprised to see that IE6 is different now.
When I developed Chili, it was just the same in all browsers, and I was quite proud of it, due to the many issues that I had to tackle to get there.
Maybe there is something in the new jQuery that works differently, or I messed up Chili during the last rewrite.
Unfortunately I no longer have IE6 installed in any PC I can think of now (home, work, friends) so it’ll be very difficult to track down the culprit for me.
Just installed the 3.0-alpha version on an intranetsite and wrote two rudimentary recipes to highlight COBOL and JCL. The plugin works great and is much ‘lighter’ than the other available highlighter plugins (especially the one using Geshi). My compliments. Looking forward to the official release (and documentation) of v3.0.
“Renders identically on IE, Firefox, Mozilla, Opera, and Safari”
I’m seeing very different results in IE6 and Firefox.
IE6: http://tinypic.com/r/315ixw8/4
Fx: http://tinypic.com/r/2r4r05j/4
It’s very good.
I like this.
Thanks for share.
And I wrote something to introduce this project for my readers.
You can find the post about this in my website.
If something is wrong,pls figure it out.thanks.
I have just integrated this into a project and it is awesome.
hi, thanks for creating this fastest highlighting plugin for jquery, i\’m using chilli 2.2.
here\’s the content of my body
var test = {}; for(var x=0;x3) test[x] = x;ChiliBook.recipeFolder = "SOMEWHERE/";
ChiliBook.automatic = false;
$( function() {
$( \'#highlight\' )
.one( \'click\', function() {
var time1 = new Date();
var $chili = $( \'#jq\' ).chili();
var time2 = new Date();
var delta = time2 - time1;
var spans = $chili.find( \'span\' ).length;
var rate = Math.round( spans / delta * 100 ) / 100;
$( \'#highlight\' ).html(
\'highlight done in \' + delta + \' milliseconds\'
+ \' with \' + spans + \' spans\'
+ \' at a rate of \' + rate * 1000 + \' span/sec\'
);
} )
.show()
;
} );
and here\’s the content of my javascript script:
$(function() {
ChiliBook.recipeFolder = \”/r/js/jqc/\”;
ChiliBook.automatic = false;
ChiliBook.lineNumbers = true;
$( \’#test1 > pre > code\’ ).chili();
$( \’#test2 > pre > code\’ ).chili();
$( \’#test3 > pre > code\’ ).chili();
});
the ajax of loading html.js and js.js was working just fine, but it seems that there are no syntax highlighting completed.. it still show black on white..
i wonder was there anything wrong with it..
please reply if you\’re not busy ^^
Thank you in advance
Regards,
Kiswono P
GB
where to get js class for perl
I have made an xml syntax highlighter for chili. Does the job for what I need and I am happy to share it. You can find it at http://blog.bayestech.com/post/jQuery-Chili-xml-support-plugin.aspx
Just let me know if there are any other features of xml you would like support for.