Posted on February 14th, 2007 by headwedge
WARNIING Blogging in the bar, cocktails fuelled musings: Not being able to get a ref to the filter object is a bit of a pain when it comes to initialising it. Which, in turn, limits abstracting and generalising the class. However, the filter registration function at least allows one to pass a parameter which becomes [...]
Filed under: code, colouriser, php, pie in the sky | No Comments »
Posted on February 7th, 2007 by headwedge
Here is a quick try at a filter to add font tags around the opening and closing PHP script tags.
The colouring and layout filters are both appended to the stream and then used on the test harness and the source script to produce the following output:
Filed under: code, colouriser, php | No Comments »
Posted on February 4th, 2007 by headwedge
Having played with adding tags to colour the code it became clear that a FSM to reproduce the layout was the first problem to tackle. Separating this functionality out into its own filter improved flexibility.
Coding a FSM to replace < and > with < and > character codes is trivial. Similarly inserting a〈BR〉 tag for [...]
Filed under: code, colouriser, php | No Comments »
Posted on January 29th, 2007 by headwedge
My preferred design approach for the ‘code-colouriser’ would be for it to filter a PHP script through a suitably trained finite state machine (FSM). After a bit of rummaging in the online PHP manual I was pleased to find that PHP 5 has a rich, if poorly documented, set of stream functions [link] and, [...]
Filed under: code, colouriser, php | No Comments »
Posted on January 25th, 2007 by headwedge
I was a bit glum to see that prettyprinter.de [link] seems to be broken after its css refit with round corners…
PHPDocumentor [link] is okay but a bit, well, on the ‘complete’ side and for quick code samples the css approach is a bit of a faff…
GeShi [link] is good but it does some pretty mad [...]
Filed under: code, colouriser, pie in the sky | No Comments »