Sunday 2 September 2012

Doxygen : Documentation of your Source Code

If you are working on big projects then documentation is very important for keeping your audience skilled and make them understand about your development.

There are various automated tools that automatically document your code. Moreover from the comments that you put up in between your code that are taken by these tools and used in your documentation. These tools make tex files, html pages for your software code automatically. There are many automated  tools  available some are

                             Javadoc - specifically used to document java code.
                             doxygen- c,c++,java and document code in various languages

some of the tools and their comparative feature are stated on this wikipedia link

http://en.wikipedia.org/wiki/Comparison_of_documentation_generators

just visit this link and have a look on various features.

I have settled up doxygen for documentation of our project on my Linux machine.

Installation of Doxygen-
1. Directly you can install it from synaptic manager. There is separate package available, atleast i know above Ubuntu 11.04 it is available as separate package and you can download and install it from Ubuntu Software Center.

2.if you want to install it using binary installation then you can download doxygen from
               http://www.stack.nl/~dimitri/doxygen/download.html
on this link binary distribution is available this is compiled code for the software for linux and windows.  You just have to extract it and make it install on proper place.

Using Doxygen-

1. Creation of doxyfile, that is a configuration file where you configure for the documentation. 
for creating doxyfile just go into the main directory of your project and
use

$doxygen -g
(A doxyfile configuration file is created with the name doxyfile)

$doxygen -g filename
doxygen configuration file is created with the name as filename

 2. Now doxyfile has been created you have to set or configure various parameters in this doxyfile, just study this doxyfile and set various parameters according to your requirements.

3. For compilation use

$doxygen
this command will compile your doxyfile and generate, two directories name
html and latex.
these directories will contain the documentation in the form latex file and in the form of webpage.

Important thing is to set various configuration parameters in configuration file, like path of  source files, files you want to document etc. etc. just have a look on
doxyfile created using the command $doxygen -g
and you will get to know various parameters you have to set. ...

Another important thing is coding style and adding comments in between your source code. There is specific style for writing the comments so that doxygen can compile it and take out the comments and convert them in the proper documentation.

If you have doubt can comment. More finer details like how to set various parameters of doxyfile would be discussed in next posts.

 "Happy documentation"........

 


No comments:

Post a Comment