Chili 1.8b Released Today

UPDATE: Chili 1.8c has been released

Changes
  • Fixed a bug that showed up when the content of an element to highlight was not a single chunk: in that case the content was erased. Now such an element won’t be highlighted by Chili.
    Content without markup is one chunk, which makes it possible to apply Chili’s markup.
Files
  • download all in a zip
  • read the manual
  • Examples
    • bundled languages
      this page shows how Chili highlights the bundled languages: JavaScript, PHP, MySQL, XHTML, Java, C++, C#, Delphi, and LotusScript (BTW, using the dynamic and automatic setup)
    • static, automatic, adhoc: this page shows how to setup Chili for
      • downloading recipes and stylesheets all at once, using HTML
      • highlighting code sections automatically
      • highlighting code sections ad-hoc
    • dynamic, automatic, adhoc: this page shows how to setup Chili for
      • downloading recipes and stylesheets as needed, using AJAX
      • highlighting code sections automatically
      • highlighting code sections ad-hoc
    • dynamic, automatic, adhoc, metaobjects: this page shows how to setup Chili for
      • downloading recipes and stylesheets as needed, using AJAX
      • highlighting code sections automatically
      • highlighting code sections ad-hoc
      • highlighting code sections using special recipes and stylesheets, by means of metaobjects
    • all the other combinations: this page shows all the other possible combinations

Chili 1.8a Released Today

UPDATE: Chili 1.8b has been released

Changes
  • Fixed a bug that showed up when the metadataSelector option was an empty string. Now that value is used for telling Chili not to execute the metaobjects plugin (which Chili executes by default)
  • Some minor cleanup
  • Renamed the bundled jQuery library to reflect the correct version number (1.1.2)
Files
  • download all in a zip
  • read the manual
  • Examples
    • bundled languages
      this page shows how Chili highlights the bundled languages: JavaScript, PHP, MySQL, XHTML, Java, C++, C#, Delphi, and LotusScript (BTW, using the dynamic and automatic setup)
    • static, automatic, adhoc: this page shows how to setup Chili for
      • downloading recipes and stylesheets all at once, using HTML
      • highlighting code sections automatically
      • highlighting code sections ad-hoc
    • dynamic, automatic, adhoc: this page shows how to setup Chili for
      • downloading recipes and stylesheets as needed, using AJAX
      • highlighting code sections automatically
      • highlighting code sections ad-hoc
    • dynamic, automatic, adhoc, metaobjects: this page shows how to setup Chili for
      • downloading recipes and stylesheets as needed, using AJAX
      • highlighting code sections automatically
      • highlighting code sections ad-hoc
      • highlighting code sections using special recipes and stylesheets, by means of metaobjects
    • all the other combinations: this page shows all the other possible combinations

How to download scripts and stylesheets

With the help of some basic DOM manipulation and no AJAX at all it is possible to write some useful functions for downloading scripts and stylesheets after the page has been loaded.

load_javascript = function( uri ) { if( document.createElement ) { var e = document.createElement( "script" ); e.type = "text/javascript"; e.src = uri; document.getElementsByTagName( "head" )[0].appendChild( e ); } }; load_javascript_inline = function( sourceCode ) { if( document.createElement ) { var e = document.createElement( "script" ); e.type = "text/javascript"; e.text = sourceCode; document.getElementsByTagName( "head" )[0].appendChild( e ); } }; load_stylesheet = function( uri ) { if( document.createElement ) { var e = document.createElement( "link" ); e.rel = "stylesheet"; e.type = "text/css"; e.href = uri; document.getElementsByTagName( "head" )[0].appendChild( e ); } }; load_stylesheet_inline = function( sourceCode ) { if( document.createElement ) { var e = document.createElement( "style" ); e.type = "text/css"; if( e.styleSheet ) { // IE e.styleSheet.cssText = sourceCode; } else { var t = document.createTextNode( sourceCode ); e.appendChild( t ); } document.getElementsByTagName( "head" )[0].appendChild( e ); } };