Saturday, 6 June 2009

Simplify and beautify documentation using Doxygen

Doxygen is a tool that generates documentation for certain types of code in a number of languages such as C++, python, Java, C and Objective C, Fortran, PHP, VHDL etc. The documentation is written within code, and is thus relatively easy to keep up to date. Doxygen can cross reference documentation and code, so that the reader of a document can easily refer to the actual code. KDE uses Doxygen for parts of its documentation and KDevelop has built-in support for it. And as one would expect, its free and is released under GNU public licence, and is cross platform.

Here is a sneak preview of what doxygen can do;
  1. It can generate an on-line documentation browser (in HTML) and/or an off-line reference manual (in $\mbox{\LaTeX}$) from a set of documented source files. There is also support for generating output in RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code.
  2. You can configure doxygen to extract the code structure from undocumented source files. This is very useful to quickly find your way in large source distributions. You can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically.
  3. You can even `abuse' doxygen for creating normal documentation (as I did for this manual).
For more info, look at doxygen