LogoPhly, boy, phly
the weblog and site of Matthew Weier O'Phinney

Tuesday, June 14. 2005

PHP Application Documentation

Paul Jones has written an interesting piece about documentation in the PEAR project, in which he argues very convincingly for using wikis for end user documentation.

I actually think that last point bears repeating: using wikis for end user documentation. I talked to Paul about this issue at php|Tropics, and both of us use phpDocumentor quite religiously. However, API documentation is very different from end user documentation. And the issue with documentation at the PEAR project has to do with the fact that there are many projects with little or no end user documentation -- which often makes it difficult for a developer to determine how a module might be used.

The often-cited barrier for this is that end user documentation on the PEAR website must be done in DocBook format.

For the record, I hate maintaining DocBook format. I created the tutorials for Cgiapp using it, and I dread having to go back into them to update or add new sections.

Why? Well, for starters:

  1. I don't use XML on a daily basis. If I need to deal with XML, I typically create a template and have a script fill it. Or I use a parser. But I don't write it by hand.
  2. DocBook doesn't use the same tagset as HTML. This means that I have to try and remember different tags, and which work in which arena.
  3. Related to (2) is that because the actual tags available can vary based on the DTD, VIM doesn't have keystroke macros to create the begin/close tags. This is a feature I use in editing HTML daily, and which speeds up my writing time. So, writing DocBook is slower than writing HTML (or plain text) by a significant factor. (Yes, I could write VIM macros for often used tags, but then I'd need to learn more about VIM scripting, and who has the time?)
  4. I already know and use HTML on a daily basis. I use plain text on a daily basis (did I mention I use VIM?). I'm comfortable in these environments. Why would I use anything else?

But I think the point that is often overlooked is that PHP was written to create web pages. Let that sink in for a moment. Why would a PHP project encourage writing documentation in anything other than the language of the web, HTML? Indeed, why would it discourage writing web-ready documentation?

As Paul noted, while wikis may not be great for all documentation purposes, they're more than adequate for most. In most projects, you're not going to need tables to document the project; several levels of headings, paragraphs, and some list elements will do the trick. Wikis can do all of these things. And they allow these things to be done easily, and for the results to be instantly available (rather than on a once-daily basis, as is the case for the PEAR web documentation, which must be compiled from DocBook).

My suggestion? Since DocBook can be exported to almost anything, export the PEAR documentation to a wiki format, and then use wikis for all but the most complex documentation. Do the complex docs in HTML, or, if you really feel the need for an output-agnostic format, use DocBook then. (My guess is that if the above were implemented, we wouldn't see much DocBook after more than a year.)

Maybe by reducing the barrier to creating usable end-user documentation, we'll start seeing a proliferation of documentation on PEAR to augment the great code that's been appearing there.

Posted by Matthew Weier O'Phinney in PHP at 23:07 | Comments (9) | Trackbacks (0)

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

...and once you have your documentation in the wiki format, it is easy to convert to PDF using HTMLDOC (http://www.htmldoc.org/)
#1 Henri Bergius (Link) on 2005-06-15 04:24 (Reply)
"we'll start seeing a proliferation of documentation on PEAR to augment the great code that's been appearing there."

In an ideal world maybe, the fact is that people are "lazy".

We proposed many times to convert whatever formats used to write docs to docbook, allowing people to finally write documentations. How many docs did we get? Null, absolutely zero. So yes, people can argue for the next ten years about docbook, in between just write docs using text or ReST and send it to peardoc, maybe some other will realize how cooperation can work.

As a sidenote, I did not see any docs from Paul, only complaints about docbook, Paul, as I told you, you may send us some nice text docs?


--Pierre
#2 Pierre on 2005-06-15 05:37 (Reply)
The difference between allowing documentation submissions in alternate formats and using wikis for end user documentation is that, with a wiki, one merely edits the page. One step. No submission, other than pressing 'Submit' on the form once your edits are done. There's no sending it to peardoc, no waiting for the next documentation compilation cycle; it's instantaneous from the documentor's standpoint.

And please remember, I'm referring here to end user documentation only. API documentation needs to take place in the code docblocks, and will always require CVS access (or patch submission). This is strictly for the 'metadocumentation' that tells the user *how* to use the package -- tutorials, and all.
#2.1 Matthew Weier O'Phinney (Link) on 2005-06-15 07:53 (Reply)
Hey, Pierre -- I have a metric assload of end-user docs out at wiki.ciaweb.net, to which the PEAR-DOC pages for my projects link. In addition, all the API docs are auto-generated by PhpDocumentor on pear.php.net. Contact me personally if there's something else you'd like me to do. Thanks.
#2.2 Paul M. Jones (Link) on 2005-06-15 08:24 (Reply)
"But I think the point that is often overlooked is that PHP was written to create web pages. Let that sink in for a moment. Why would a PHP project encourage writing documentation in anything other than the language of the web, HTML? Indeed, why would it discourage writing web-ready documentation?"

Wow. That's a great point. Can't believe I didn't think of it myself. :-)
#3 Paul M. Jones (Link) on 2005-06-15 08:26 (Reply)
"Why would a PHP project encourage writing documentation in anything other than the language of the web, HTML?"

HTML is too simple. Read my original post. Docs need more meta-information than HTML provides.

Yes, this COULD be hacked up using a set of class="cssclass" params, but it would be harder to maintain than docbook, IMO.

S
#4 Sean Coates (Link) on 2005-06-15 14:04 (Reply)
Could you give some examples of the meta-information needed by the PEAR documentation project that HTML wouldn't be able to provide? And confine this to end user documentation -- not the API documentation, please.

The only specific you mention in your post is the methodsynopsis block -- which should be generated by phpDocumentor from the phpdoc blocks in the class. I'd like examples from within the end user documentation; perhaps with these I might better see your point. Right now, I'm still not convinced.
#4.1 Matthew Weier O'Phinney (Link) on 2005-06-15 14:38 (Reply)
I know it's not PEARdoc, but here's an excerpt from the classkit docs (which are deprecated, but a good example of what I'm talking about):

You blog screws with < and > (and also &lt;, &gt;)
so, see here: http://www.phpdoc.info/docbook/htmlvsdocbook.txt

S
#4.1.1 Sean Coates (Link) on 2005-06-15 17:31 (Reply)
For links, just use standard anchors:

< a href="#ref.classkit" > classkit < / a >

If the link ends up on a different page from the id, just add classkit.html before the #.

For abbeviations, we have the < abbr > tag or < acronym >, or you could add a title="APD" to the header tag. HTML has all this built in.

I think you're asking for trouble using entities like that, what better way is there to say "you're not welcome to write docs" than invent a new XML spec, and fill it with cryptic entity references?

Douglas
#4.1.1.1 Douglas Livingstone on 2005-08-23 08:06 (Reply)

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
 
  • Home
  • Resume
  • Blog
  • Phly PEAR Channel
  • Contact Me
  • About this site

ZCE

Zend Education Advisory Board Member

Add to Technorati Favorites

Calendar

Back August '08 Forward
Mon Tue Wed Thu Fri Sat Sun
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Quicksearch

Links

  • PHLY - PHp LibrarY
  • Paul M. Jones
  • Mike Naberezny
  • Shahar Evron
  • Planet PHP
  • Zend Where I now work
  • Garden.org Where I once worked

Archives

August 2008
July 2008
June 2008
Recent...
Older...

Categories

XML Linux
XML Personal
XML Aikido
XML Family
XML Programming
XML Perl
XML PHP

All categories

Syndicate This Blog

XML RSS 0.91 feed
XML RSS 1.0 feed
XML RSS 2.0 feed
ATOM/XML ATOM 0.3 feed
ATOM/XML ATOM 1.0 feed
XML RSS 2.0 Comments

Show tagged entries

xml best practices
xml books
xml conferences
xml dojo
xml dpc08
xml file_fortune
xml linux
xml mvc
xml pear
xml personal
xml php
xml programming
xml ubuntu
xml webinar
xml zendcon
xml zend framework
© 2004 - present, Matthew Weier O'Phinney
matthew-web <at> weierophinney.net