Feb 04 2007

HTML Recipe: Dashed Attributes

Tag: ChiliAndrea Ercolino @ 00:54:34

Another little improvement for the HTML recipe. This time is for properly highlighting attributes whose name contains a dash, like “http-equiv”. I also touched the tag rule, so that the DOCTYPE is recognized now:

/*
===============================================================================
Chili Recipe for the XHTML language
...............................................................................

Version: 1.5b - 2007/02 - http://noteslog.com/chili/

-------------------------------------------------------------------------------
Copyright (c) 2006 Andrea Ercolino
http://www.opensource.org/licenses/mit-license.php
===============================================================================
*/

{
	steps: {
		  mlcom : { exp: /\<!--(?:.|\n)*?--\>/ }
		, tag   : { exp: /(?:\<\!?\w+)|(?:\>)|(?:\<\/\w+\>)|(?:\/\>)/ }
		, aname : { exp: /\s+[\w-]+(?=\s*=)/ }
        , avalue: { exp: /([\"\'])(?:(?:[^\1\\]*?(?:\1\1|\\.))*[^\1\\]*?)\1/ }
		, entity: { exp: /&[\w#]+?;/ }
	}
}


Feb 02 2007

HTML Recipe: Multiline Attributes

Tag: ChiliAndrea Ercolino @ 23:19:33

Some days ago I discovered that an HTML tag can have attributes whose values span multiple lines. This is very useful when the value is a piece of javascript code, which in fact is immune to white space.

The HTML recipe I bundled to Chili 1.5 is a bit wrong, though, because it doesn’t consider that possibility. This is one that does:

/*  
===============================================================================
Chili Recipe for the HTML language
...............................................................................

Version: 1.5a - 2007/02 - http://noteslog.com/chili/

-------------------------------------------------------------------------------
Copyright (c) 2006 Andrea Ercolino
http://www.opensource.org/licenses/mit-license.php
===============================================================================
*/

{
	steps: {		
		  mlcom : { exp: /\<!--(?:.|\n)*?--\>/ }
		, tag   : { exp: /(?:\<\w+)|(?:\>)|(?:\<\/\w+\>)|(?:\/\>)/ }
		, aname : { exp: /\s+\w+(?=\s*=)/ }
        , avalue: { exp: /([\"\'])(?:(?:[^\1\\]*?(?:\1\1|\\.))*[^\1\\]*?)\1/ }
		, entity: { exp: /&[\w#]+?;/ }
	}
}


Feb 01 2007

More recipes for Chili 1.5

Tag: ChiliAndrea Ercolino @ 17:48:32

I’ve found that dp.SyntaxHighlighter is similar to Chili, in that it uses language descriptions based on JavaScript regular expressions, so it’s quite easy to convert them to Chili recipes. Here are the first 5 conversions (more to come): Java, C++, C#, CSS, and Delphi.


Jan 26 2007

Chili 1.5 Released Today

Tag: Chili, MetaobjectsAndrea Ercolino @ 19:30:12

UPDATE: Chili 1.6 has been released

Changes

  • Changed the recipes format to JSON. Previous recipes need a small conversion. Just compare to a JSON recipe and you’ll see how to
  • Improved support for dynamic setups, by means of metaobjects, which allow a clean configuration on a per element basis
  • Improved support for static setups
  • New examples show how to configure static and dynamic setups
    • static: recipes and stylesheets linked from the page
    • dynamic: recipes and stylesheets downloaded on demand
  • The examples also show how to mix languages in the same page, manually configure a mixed language setup, use metaobjects, use a dynamic download in a static setup
  • Added an option for preventing CSS downloading on demand
  • Added a new recipe and example for pure HTML
  • Updated the bundled jQuery library to version 1.1.1
  • Dropped support for Code Highlighter styleSets. It’s very easy to convert a styleSet to a JSON recipe, though
  • Fixed a bug in the white space’s rendering
  • Improved the white space’s rendering in Opera9.1
  • Added scope protection to all the Chili code
  • Tested with IE7, FF1.5, Opera9.1

Files

  • download all in a zip
  • read the manual
  • Examples (static)
  • Examples (dynamic)

Dec 23 2006

Chili 1.4 Released Today

Tag: ChiliAndrea Ercolino @ 22:08:29

UPDATE: Chili 1.5 has been released

Changes

  • Fixed a bug in the computation of the backreferences
  • Improved control and rendering of white space
  • Changed the method for detecting an already loaded CSS
  • Added a new recipe and example for MySQL
  • Updated the bundled jQuery library to version 1.0.4
  • Cut the bundled manual.txt to a stub (all is online)

Files

  • download all in a zip
  • read the manual
  • Example: Chili highlighting Chili
  • Example: Chili highlighting jQuery
  • Example: Chili highlighting PHP
  • Example: Chili highlighting MySQL

Dec 07 2006

Chili 1.3 Released Today

Tag: ChiliAndrea Ercolino @ 10:08:18

UPDATE: Chili 1.4 has been released

Changes

  • Fixed a bug in the formula for computing the number of submatches of a regular expression: parentheses not explicitly escaped inside a character class are escaped by default, but Chili didn’t take care of them.
  • Replaced the explicit MIT Licence, with a link to it.
  • Added “?:” to many parenthesized expressions (inside recipes) that were being used just for grouping.
  • Removed the trace helper. Try the Firebug lite console instead.

Files

  • download all in a zip
  • read the manual
  • test Chili highlighting Chili
  • test Chili highlighting jQuery
  • test Chili highlighting PHP

Nov 09 2006

Chili 1.2 Released Today

Tag: ChiliAndrea Ercolino @ 17:12:29

UPDATE: Chili 1.3 has been released

Changes

  • Added two new options for finer control over which elements of the page get highlighted
  • Fixed a bug that broke pages when Chili tried to highlight a code element without a class definition. (thanks to choan)
  • Globally replaced by to validate xhtml. (thanks to choan)

Files

  • download all in a zip
  • read the manual
  • test Chili highlighting Chili
  • test Chili highlighting jQuery
  • test Chili highlighting PHP

« Previous PageNext Page »