PHPDocumentor Fork (earthli-v2)
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 earthli fork. This article includes a full feature list and screenshots.
The earthli WebCore (the software that runs this web site) is open-source. It is also relatively well-documented. The documentation is generated using PHPDoc, but a better version than that available in the main fork of PHPDoc found on the main site or in SourceForge.
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:
- Insufficient support for some of the newer PHP5 features
- Uneven information availability in the different templates
- Pretty old and staid templates
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.
Features of earthli-v2
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:
- 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:
ISO-8859-1are supported; defaults to
- Content Type:
HTMLare supported; defaults to
- Default Type: Controls the type used when none other is given: common values are
mixed; defaults to
- Source Links: Controls whether each element includes a link to source (the “#” in the screenshots); links can be included in summaries, indexes or both.
- Source Formatting: Control whether source is formatted using non-breaking spaces or regular spacing and style-sheets with control over tab-size.
- Access/Abstract Tags: Control whether
abstracttags are generated; since these properties are also indicated by the icon, defaults to
- Icon Mode: Control how icons are generated: valid values are
none; defaults to
- Section Inclusion: Control which sections are generated in the tree (as well as icon mode); defines, functions and variables can be turned on and off; default is to include everything in the tree.
- Skin: Control the look and feel: the
default(a PHPDoc standard) and
earthliskins are included; defaults to
The old style isn’t horrible, but it’s a bit dated, with too many borders, blurry icons and too many bold fonts.
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.
Downloading the Fork
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 earthli fork available as a Mercurial repository or as a compressed archive.