This page shows the source for this entry, with WebCore formatting language tags and attributes highlighted.


PHPDocumentor Fork (earthli-v2)


<abstract>PHPDoc is a popular tool for generating documentation for PHP projects. I made a whole lot of improvements to it for PHP5 and updated all the skins to look less boxy, have nicer and more informative icons and be easier to use, and then created an <a href="">earthli fork</a>. This article includes a full feature list and screenshots.</abstract> The <a href="{root}/software/webcore" source="" author="">earthli WebCore</a> (the software that runs this web site) is open-source. It is also relatively <a href="{data}/software/webcore/docs/public/" source="" author="">well-documented</a>. The documentation is generated using PHPDoc, but a better version than that available in the main fork of PHPDoc found on the <a href="">main site</a> or in <a href="">SourceForge</a>. Though PHPDoc does a decent job of gathering information and making it available to the templates, there are a few problems with the main fork: <ul> Insufficient support for some of the newer PHP5 features Uneven information availability in the different templates Pretty old and staid templates </ul> A long time ago---when PHP4 was still young---I contributed a whole new set of templates---modestly called "earthli" and "earthli:DOM"---to the project and brought the rendering up to a decent level. There were still problems, but it was---in my eyes---worlds better than any of the existing templates. Things stayed like that for a while. Then I ported my framework from PHP4 to PHP5 in early 2010 and discovered that PHPDoc was again limping along a bit, generating output that no longer met my standards. <h>Features of earthli-v2</h> So, I made a lot of improvements and again basically rewrote one set of templates (this time called "earthli-v2") that I thought looked clean and offered the following features: <ul> The HTML that is generated is purely structural, leaving formatting, coloring and other skinning up to the options. The clean structure means the files look fine without icons or styling and also should be much more accessible: both for people and processing tools. There are no more extra formatting containers and all presentational tables have been removed. The HTML now validates 100% for all generated pages. The CSS is cleanly separated into individual files and no longer includes anything that is not used. There is a base stylesheet and icon and coloring/positioning skins that allow complete control through CSS without touching the templates at all. So authors can define and tweak skins simply by adding a folder with a few CSS files and choosing that skin in the options file. Options include: <ol> <b>Encoding</b>: <c>UTF-8</c> and <c>ISO-8859-1</c> are supported; defaults to <c>UTF-8</c>. <b>Content Type</b>: <c>XHTML</c>and <c>HTML</c> are supported; defaults to <c>HTML</c>. <b>Default Type</b>: Controls the type used when none other is given: common values are <c>object</c>, <c>stdClass</c>, <c>mixed</c>; defaults to <c>mixed</c>. <b>Source Links</b>: Controls whether each element includes a link to source (the "#" in the screenshots); links can be included in summaries, indexes or both. <b>Source Formatting</b>: Control whether source is formatted using non-breaking spaces or regular spacing and style-sheets with control over tab-size. <b>Access/Abstract Tags</b>: Control whether <c>access</c> and <c>abstract</c> tags are generated; since these properties are also indicated by the icon, defaults to <c>false</c>. <b>Icon Mode</b>: Control how icons are generated: valid values are <c>css</c>, <c>img</c> and <c>none</c>; defaults to <c>css</c>. <b>Dynamic</b>: Control over whether Javascript is used; defaults to <c>false</c> <b>Section Inclusion</b>: Control which sections are generated in the tree (as well as icon mode); <i>defines</i>, <i>functions</i> and <i>variables</i> can be turned on and off; default is to include everything in the tree. <b>Skin</b>: Control the look and feel: the <c>default</c> (a PHPDoc standard) and <c>earthli</c> skins are included; defaults to <c>earthli</c>. </ol> </ul> <h>Screenshots</h> The old style isn't horrible, but it's a bit dated, with too many borders, blurry icons and too many bold fonts. <div align="center"> <img attachment="phpdoc_-_earthli_dom_-_home_page_-_old.png" align="left" class="frame" caption="Old-style Home Page"><img attachment="phpdoc_output_-_earthli_dom_-_old.png" align="left" class="frame" caption="Old-style class page with Index"> </div> The new style is cleaner, has far fewer borders, better margins and alignments and nicer icons (for all elements, with access visibility for all element types) as well as much more legible placement and more information, including direct links to source for all elements, much nicer signature-formatting and tamer colors. <div align="center"> <img attachment="phpdoc_-_home_page_-_earthli_-_new.png" align="left" class="frame" caption="New-style Home Page"><img attachment="phpdoc_-_earthli_-_new.png" align="left" class="frame" caption="New-style Class Page"><img attachment="phpdoc_-_earthli_-_index_1_-new.png" align="left" class="frame" caption="New-style Index Page"> </div> <h>Downloading the Fork</h> I was in contact with the project maintainer but was never able to upload my changes into the main branch of PHPDoc. There have been no updates on the main line since late 2009 and I don't know whether the project has died or not. I only just realized that I never officially published my changes, so I'm officially making the <a href="">earthli fork</a> available as a Mercurial repository or as a compressed archive.