[Moin-devel] Modification to wiki.py

Juergen Hermann jh at web.de
Tue May 7 09:50:04 EDT 2002


On Tue, 7 May 2002 01:19:24 -0400, Nicholas Bastin wrote:

>I use shlex to turn the keywords into tokens, and colorize based upon an 
>array of token,color tuples, much like the current python colorizer.  
>It's not an optimal solution, but it works.

If you agree, I'd like you to add two things:

1. We already talked about having different sets of such language profiles 
==> make the current list of token/colors a dict of such list, with the dict 
key being the language ID.

2. Add a probe mode, so that when the language is NOT explicitely stated, we 
look at the provided source, and try to find the language definition that 
has the most "hits" on the defined tokens.

If that was too short a description, I can elaborate. For testing, you could 
add HTML definitions, so we'd have hilighted HTML and C for a start.

BTW, the best interface for such a colorizer module is taking a list of 
source lines, and emitting the resulting HTML to a provided stream.


Ciao, Jürgen






More information about the Moin-devel mailing list