Re: Need for a syntax-highlighter

From: Date: Fri, 05 Mar 2004 11:46:43 +0000
Subject: Re: Need for a syntax-highlighter
References: 1  Groups: php.pear.dev php.pear.doc 
Request: Send a blank email to pear-dev+get-26129@lists.php.net to get a copy of this message
On 5 Mar 2004 at 11:22, Davey wrote: > Stefan Neufeind wrote: > > Hi PEARs, > > > > I was recently having a look at the coloring of "programlisting"- > > parts in peardoc. In short, the docs generated in HTML-form are sent > > through "colorize.php": > > http://cvs.php.net/co.php/peardoc/colorize.php?r=1.2 which > > generates > > the highlighted version. > > > > However, currently only php-source can be highlighted because the > > script uses php's built-in features for php-highlighting. > > > > It's been mentioned on pear-doc lately that being able to highlight > > html, xml, sql etc. in a similar form would be nice. However, for > > that to happen we need a highlighter that provides similar output > > than the php-syntax-highlighting. Having a short look at the > > repository I didn't yet find a package to do this for us. > > > > So has anybody maybe already experimented with writing a highlighter > > for these files? Maybe a general package for source-highlighting > > (HTML_Highlighter or similar) would be nice. Please have a look who > > could donate some lines :-)) > > I have written highlighters for the following in a single class: > > XHTML (will probably color HTML just by making it case insensitive) > XSLT DTD Generic XML MySQL SQL Syntax (and to some extent any other > SQL's) CSS2 (which means it will also highlight CSS1) > > I have plans to write a basic JavaScript highlighter too > > I can make the code public under the PHP License, its not the > best code but it certainly does the job. > > You can test it out using the hashphp.org pastebin [1] > [1] http://hashphp.org/pastebin Will have a look ... > I hope this is of some help to you guys. Would be nice if > HTML_BBCodeParser supported: [code type="xml"] for example, > using whatever code is used for HTML_Code_Highlighter, I think > I prefer Text_Highlighter - to stop people thinking it just > highlights HTML.... not sure. Just thought that HTML might be good because it would use HTML-tags for formating. And as such it outputs HTML and belongs in the HTML- group imho. PS: Maybe also highlighting using a CSS could optionally be implemented - would be cool ... Stefan

« previous php.pear.dev (#26129) next »