Doxygen

One of the many things I love about Linux, and Ubuntu in particular is the ability to install pretty much everything you need from the package repositories, including all the development tools you could ever need.

With other operating systems, you have to purchase or download the software, then install it. Updates are made easy as the updater checks for updates for all software installed via the repositories, vs other operating systems who only update their own. Do you ever need to go outside the repositories? I rarely do (maybe once or twice out of hundreds of installs).

If you're interested in any type of development or programming, everything you need is available in the repositories, including apache server, quanta, php and mysql, all for free from one place.

Documentation is overlooked often times, but an program is available that makes documentation very easy, Doxygen. Doxygen produces documentation from specific comments in your code automatically, including cross references.

To install Doxygen:

$ sudo apt-get install doxygen, doxygen-gui

Then run doxywizard from he command line. You can use the wizard or expert mode. There are many, many options available, so be sure to play with it. But using comments like this:

/**
*@mainpage MyPage Drupal Module Documentation
*@section intro_sec Introduction
* The MyPage module aims to provide the 
* functionality necessary for a Drupal 
* site to act as a social networking 
* environment.
*@section core_sec MyPage Core
* The MyPage core is contained in mypage.module 
* and provides functionality that other modules 
* and components should use.
*@section subsystem_sec Subsystems
* The MyPage module includes the following subsystems.
*@subsection messaging_sub
* The messaging core is really a sub-core 
* component and is contained within 
* mypage_messaging.module. This component handles 
* all the site-internal communication between 
* members including private messaging and 
* bulletins.
*@section comp_sec Included Components
* MyPage supports add on components and includes 
* the following components.
*@subsection contact_sub Contact Component
* This component, contained in mypage_contact.module, 
* provides the contact form and is dependent 
* on the messaging module defined in mypage_messaging.module.  
*@subsection counter_sub Counter Component 
* This component,contained in mypage_counter.module, provides the 
* profile view counter and related functionality.
*@subsection picture_sub Picture component
* This component, contained in mypage_picture.module, uses the user's 
* picture specified within the Drupal system, and provides functionality 
* to upload and select other pictures, for display on the user's profile. 
*@subsection quote_sub Quote component
* This component, contained in mypage_quote.module, provides the user a 
* specifiable quote for display on their profile. 
*
*@file mypage.module
*@date 2008/04/04
*@author Jacob Steelsmith 'jacob@@steelsmith.org'
*@brief
* This module provides the core functionality 
* for implemented modules and components. 
*
*@bug
* The module returns a profile for 
* non-existant user. The user should be informed 
* the requested profile does not exist. 
*
*@todo
* Implement the positionable components.
*@todo
* Implement specifiable styles.
*/

doxygen will produce HTML documentation similar to this. MyPage is a Drupal module I'm developing that provides social networking functionality (think MySpace for Drupal). No need for it, just doing it in my spare time.

Using a comment block like this:

/**
*@fn null mypage_module_invoke($type, &$page, $uid)
*@author Jacob Steelsmith 'email@somewhere.org'
*@date 2008/03/11
*@brief
* Allows other modules to hook into the mypage process.
*@param $type
* Type of action being taken by the module for the call.
*@param &$page
* The page being created. Passed by reference.
*@param $uid
* The user id being worked on.
*@return
* Does not return a value.
*
* This module creates the mypage hook. any module 
* that has a function x_mypage(), where x is the 
* name of the module implements this hook. This 
* function is called throughout the core to perform 
* various functions.
*/

automatically produces documentation similar to this.

Of course, this documentation is already out of date, but it wouldn't be hard to write a script and leverage cron to automatically produce and update documentation for a development tree.

Again, this is all free and available in one spot, thanks to the open source community.