Automatically generate documentation from source code using doxygen

If  you are an open source developer then you would have seen doxygen generated documentation somewhere along your work.Doxygen supports a number of languages like C,C++,PHP,Python,Java etc.Using doxygen, you can auto-generate API reference documentation of source code, in HTML or Latex format. You can also visualize class dependency and the relationship between different source files.

To install doxygen

sudo apt-get install doxygen
sudo apt-get install graphviz

Now to view doxygen in action if you have source files use it else download this



cd allexamples

Now create a doxygen configuration file

doxygen -g my_proj.conf

Screenshot from 2014-01-08 07:58:51

Now edit the configuration file and change some options as shown below

# document all entities in the project.
EXTRACT_ALL            = YES

# document all static members of a file.

# specify the root directory that contains the project's source files.
INPUT                  = /home/ganesh/Desktop/allexamples

# search sub-directories for all source files.
RECURSIVE              = YES

# include the body of functions and classes in the documentation.

# generate visualization graph by using dot program (part of graphviz package).
HAVE_DOT               = YES

CALL_GRAPH             = YES
CALLER_GRAPH           = YES

Please not that INPUT variable must contain your path

Now run doxygen to generate documentation

doxygen my_proj.conf

Now two folders html and latex will be created inside our source code folder

cd html

find index.html and open it in browser you can see documentation.In files tab if you click on a file you can see plotting

Screenshot from 2014-01-08 08:14:04


Screenshot from 2014-01-08 08:14:23



Happy Hacking 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s