Re: Package Proposal: Tools and Utilities: PDS

From: Date: Sun, 18 May 2003 04:25:38 +0000
Subject: Re: Package Proposal: Tools and Utilities: PDS
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16434@lists.php.net to get a copy of this message
Alan Knowles wrote:
I think combining this work in a more generic way to enable it to be used by other packages would be more suitable As phpdocumenter starts considering the next version it's probably a good time to think about breaking it into smaller more manageble modules (especially so greg doesnt have to do all the work)... As far as I can see this code would fit into PHP_Render_HTML - a class that enables you to render PHP code in an 'XHTML/... etc. friendly manner.'
The beauty of the HighlightParser in phpDocumentor is that it is essentially a combination of a PHP_Render_HTML and a PHP_Render_PDF and a PHP_Render_* (which is why methods like PreserveWhiteSpace become necessary) I think your suggestions are a good starting point for 2.0. The method names I describe are simply what phpDocumentor 1.2.0's Converter has already. [snip]
-highlightDocBlockSource(phpDocumentor DocBlock token name, token string, bool true if pre-formatted) [enclose docblock tokens in highlighting] // should be covered and picked up by toHTML??
Possibly, yes. I use custom tokens for docblocks, since php doesn't have any sub-tokens within a comment, but it would be neat to be able to do something that was a bit more generic.
Ontop of this you can do structure parsing using PHP_Parser - all that PHPDocumentor has to concern it'self with is = process control.. -= deciding what data to parse. = build structure of information to output.. (eg. lists of classes, package=>classes, files etc.) = loop through and output stuff.
This is definitely the goal for 2.0. I want to be able to do things like allow multiple docblock parsers, so that we can parse doxygen/javadoc/PHPDoc/ZDE doc comments and any new doc comment format (please god let the new formats stop! :) can be handled easily by a plugin/driver This would also allow even cooler things like plugging in parsers for other languages, the sky's the limit.
It would be very nice to break phpdocu up into managable small pieces This would enable stuff like this to be done with a few lines of code calling generic renders.. You also should have a look at php's highlight source code, it specifically does code reduction to prevent stuff like this. <span class="p">(</span><span class="p">(</
This is a good thing, I didn't do this because of concern over line numbers, but it really shouldn't be hard to implement, it's true :) Greg

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