How To: Doxygen

Categories Engineering, How To, Tools

Doxygen allows the generation of documentation from source code files for various languages: C/C++, C#, JAVA, Python and others. This is a short document on how to work with it, serving as a reminder for me and maybe helping others at the same time.

1. Download and installation:

http://www.stack.nl/~dimitri/doxygen/download.html

2. Generation of the configuration file:
doxygen -g 

3. Configuration:
For JAVA:
INPUT                  = <leaving_blank_for_current_directory>
OUTPUT_DIRECTORY       = <leaving_blank_for_current_directory>
JAVADOC_AUTOBRIEF      = YES
INHERIT_DOCS           = YES
OPTIMIZE_OUTPUT_JAVA   = YES
EXTRACT_ALL            = YES
EXTRACT_PRIVATE        = YES
EXTRACT_STATIC         = YES
FILE_PATTERNS          = *.java 
RECURSIVE              = YES
EXCLUDE                =
GENERATE_HTML          = YES    #for HTML 
HTML_FILE_EXTENSION    = .htm
GENERATE_HTMLHELP      = NO     #for CHM
GENERATE_LATEX         = NO     #for Latex
LATEX_OUTPUT           = latex
GENERATE_XML           = NO     #for XML

4. Running doxygen:

$> doxygen Doxyfile
Searching for include files...
Searching for example files...
Searching for images...
Searching for dot files...
Searching for msc files...
Searching for dia files...
Searching for files to exclude
Searching INPUT for files to process...
Searching for files in directory /home/cg/root
Searching for files in directory /home/cg/root/documentation
Reading and parsing tag files
Parsing files
Reading /home/cg/root/HelloWorld.java...
Parsing file /home/cg/root/HelloWorld.java...
Building group list...
Building directory list...

5. Reaping and profiting:

-rw-r--r-- 1 45136 45136  746 May 12 17:53 doc.png
-rw-r--r-- 1 45136 45136  25K May 12 17:53 doxygen.css
-rw-r--r-- 1 45136 45136  616 May 12 17:53 folderclosed.png
-rw-r--r-- 1 45136 45136  597 May 12 17:53 folderopen.png
-rw-r--r-- 1 45136 45136 4.0K May 12 17:53 functions.html
-rw-r--r-- 1 45136 45136 3.9K May 12 17:53 functions_func.html
-rw-r--r-- 1 45136 45136 3.3K May 12 17:53 index.html
-rw-r--r-- 1 45136 45136   95 May 12 17:53 nav_g.png
drwxr-xr-x 2 45136 45136 4.0K May 12 17:53 search
-rw-r--r-- 1 45136 45136  314 May 12 17:53 splitbar.png
-rw-r--r-- 1 45136 45136  853 May 12 17:53 sync_off.png
-rw-r--r-- 1 45136 45136  845 May 12 17:53 sync_on.png
-rw-r--r-- 1 45136 45136  676 May 12 17:53 bc_s.png
-rw-r--r-- 1 45136 45136  147 May 12 17:53 bdwn.png
-rw-r--r-- 1 45136 45136  132 May 12 17:53 closed.png
-rw-r--r-- 1 45136 45136 3.7K May 12 17:53 doxygen.png
-rw-r--r-- 1 45136 45136 3.1K May 12 17:53 dynsections.js
-rw-r--r-- 1 45136 45136 143K May 12 17:53 jquery.js
-rw-r--r-- 1 45136 45136  153 May 12 17:53 nav_f.png
-rw-r--r-- 1 45136 45136   98 May 12 17:53 nav_h.png
-rw-r--r-- 1 45136 45136  123 May 12 17:53 open.png
-rw-r--r-- 1 45136 45136  142 May 12 17:53 tab_a.png
-rw-r--r-- 1 45136 45136  169 May 12 17:53 tab_b.png
-rw-r--r-- 1 45136 45136  177 May 12 17:53 tab_h.png
-rw-r--r-- 1 45136 45136  184 May 12 17:53 tab_s.png
-rw-r--r-- 1 45136 45136 1.2K May 12 17:53 tabs.css

And this is how JAVA documentation looks – pretty spiffy!
doxygen_java

Leave a Reply