Skip to content
aercolino edited this page Sep 13, 2010 · 44 revisions

Currently Chili is at version 2.2, which is older than 1,5 years !!

I’ve started the development of the next version on January 2010.
I still don’t know if it’ll be version 3, or 2.3: we’ll see.

Goals for the next version:

  1. refactor the code so that functions get smaller and easier to understand
  2. change the directory structure of the project, so that other developers can join more easily
  3. extract code from chili.js into independent files under src; then update build.xml to concatenate them again into chili.js
  4. integrate the global Chili object into a property object of jQuery, like jQuery.chili.options
  5. rename recipes; example: instead of recipes.js use jquery.chili.recipes.js, instead of php.js use jquery.chili.php.js
  6. fix line numbering, which now breaks after a multiline comment (…examples/geshi1.0.7.22-n.html)
  7. make each recipe a real jquery.chili plugin; this way recipes.js will be created by concatenating plugins
  8. make chili compatible with jQuery 1.4
    In previous versions of jQuery, JSON evaluation went through eval, but now it goes either through a built-in JSON object, if available, or the “new Function()” workaround. When using recipes loaded by ajax, the new JSON evaluation generates a parse error and nothing gets colored.
  9. instead of <pre><code>...</code></pre> use <code></code> alone this is not ‘cleanly’ possible due to IE not honoring new lines (\r) when reading text from a DOM element X whose white-space is not ‘pre’ right into the HTML source. There are two ways in IE for setting white-space to ‘pre’ for X, right into the HTML: 1- by putting X inside a PRE; 2- by setting the CSS of X. Users can choose what they prefer, Chili won’t care.
  10. instead of &#160;<br /> and &#160; use real newlines and spaces respectively this is not possible due to IE not honoring new lines (\r) when setting the innerHTML of a DOM element
  11. move ‘ln-’ class to CODE. This implies changing the schema for adding metadata.
    1. use “chili-lang-php” instead of just “php”
    2. use “chili-ln-1”, instead of just “ln-1”
  12. use <li>, instead of &nbsp;<br>, and style <pre><code><ul> so that no bullets are shown
  13. make a CODE class like “chili-off-11-13-17-19” turn off any highlighting for all chars between line 11, offset 13 (inclusive) and line 17, offset 19 (not inclusive)
  14. make a CODE class like “chili-custom-11-13-17-19-better” apply the “better” class to all chars between line 11, offset 13 (inclusive) and line 17, offset 19 (not inclusive)
  15. improve the configuration options. For example, make the selection window optionable
  16. add unit tests
  17. fix the PHP recipe
    Currently the recipe doesn’t work properly when recipes are loaded by ajax. The culprit is this instruction:
    var html = this.x( no_php_2, 'html' );
    In fact, if the html recipe is still to be downloaded, then the html variable becomes equal to no_php_2 instead of the transformation of no_php_2 by means of the html recipe. This will ultimately cause a replacement that wipes out all previous replacements.
  18. improve all the recipes so that they pass tests like Tricky Code Snippet From Hell
  19. improve the documentation
  20. make it easier for contributors to publish their own recipes

Notes about the next version

  • maybe it’s worth making a better object with a recipe; I mean, we could take the recipe JSON object and add methods and properties to it so that we can later call methods on it like: recipe.hilite(text)
  • for lineNumbers it could be better to use <li> from the start, instead of &nbsp;<br>, so we could use <ul> or <ol> as a wrapper, after a given option of course; in that case <pre><code><ul> should be styled accordingly so that no bullets are shown
Clone this wiki locally