I've been thinking about where we might want to go with the API documentation in the near, and not so near, future. Although
http://api.joomla.org has served us well over the years, the Joomla API documentation has long been in need of improvement. In particular, our goal of supporting and encouraging user-contributed notes and code samples has proved somewhat elusive although some good progress has been made recently. Since the API documentation is important for developers (obviously) and given our intention to launch a new developer website, I'd like to get some feedback from the rest of the team on where we want to go with the API documentation.
Where we are nowphpDocumentor is good at producing a comprehensively cross-referenced and good looking resource (although the code is a big pile of spaghetti), but it doesn't produce predictable URLs (because the URL includes the sub-package name and you can't deduce the sub-package name from the class name).
We also have manually-written pages starting from here:
http://docs.joomla.org/Framework. Although there is some useful information in there they suffer from being, well... manual.
Doxygen is simple and fast and produces predictable URLs, but doesn't produce quite such nice output. However, Alex Bachmann has written Doxiki which can update the wiki directly from Doxygen output, although I would think twice about running it nightly as the wiki keeps a full version history and I can see that getting huge. I need to do some research on whether it is possible to easily delete an entire namespace together with its version history as this would make things a lot cleaner. You can see the output from Doxiki here:
http://docs.joomla.org/API15:Framework and here:
http://docs.joomla.org/API16:Framework
We also have an extension to the wiki installed which supports addition of comments and code samples. A combination of namespacing and tagging means that comments are not overwritten when a fresh run of Doxiki is made. Furthermore, a new version of Joomla will automatically carry forward the comments from earlier versions and tagging can be used to refine that. With some more work we can get the output from Doxiki to look good and make it more obvious that users can add comments.
Goals- Provide rich access to API information.
- Support for comments and user-contributed code samples (php.net does this particularly well).
- Predictable URLs for classes and methods. This will make it possible for tools such as Eclipse to automatically retrieve API documentation pages.
- Must be able to cope with different Joomla versions. That is, major and minor releases should have separate documentation areas. Maintenance releases can overwrite.
- Some level of multi-lingual support must be available.
- Automate as much as possible (continuous integration, etc.)
ProposalI'd like to propose the following for our API documentation going forward.
- Generate phpDocumentor output at developer.joomla.org/API/1.6 (okay, this clashes with the URLs suggested below so we'll need to resolve that issue) triggered by Hudson. This is already being done.
- Embed links in the code itself (using @link) to predictable URLs. Something like: @link http://developer.joomla.org/API/1.6/className/methodName. This is a one-time task that is easy but time-consuming. We won't need to change these except when a new major or minor version is started and then we can do a simple find and replace on them. These URLs need to be highly stable over a long period of time so as to encourage developers to make use of them in tool integrations (eg. Eclipse).
- Use a component in http://developer.joomla.org to serve transcluded wiki pages from these predictable URLs. So http://developer.joomla.org/API/1.6/className/methodName will transclude http://docs.joomla.org/API16:className/methodName. I think this can be done using the wiki proxy component already developed, together with a little custom router. Need to make sure that the comment extension will work correctly in this setup.
- Further develop the Doxiki code to generate output that makes it clearer that user-contributed notes are encouraged. Run Doxiki every time a major or minor Joomla release is made. Maybe more often if lots of changes are being made to the code between versions or if we can solve the problem of the wiki keeping full version history for the Doxiki namespace.
- Links to appropriate pages on http://api.joomla.org need to be entered manually into the wiki pages as the URLs are not predictable. However, this can be done by adding the links in the See Also section of the doxiki-generated pages which works the same way as comments, so it only has to be done once and it doesn't get overwritten by later versions.
So in effect we end up with two resources: the output from phpDocumentor in sub-directories under the new developer website and the output from Doxygen in wiki content pages with commenting, but transparently also available in the new developer website. Each of these resources contains cross-references to the other. Plus, we pave the way for tools such as Eclipse to integrate cleanly into the documentation. This arrangement also helps focus people on the developer site for this kind of information.
Thoughts? Comments? Ideas?
Regards,
Chris.
--
Chris Davenport
Joomla Leadership Team - Production Working Group
Joomla Documentation Coordinator