330 likes | 838 Views
Doxygen. Presented by Sweatha Viswanathan. Doxygen (pronounced as “Docs-ee-gen”). It is a Documentation generator Free software released under the terms of the GNU General Public License Developed by Dimitri van Heesch
E N D
Doxygen Presented by Sweatha Viswanathan
Doxygen (pronounced as “Docs-ee-gen”) • It is a Documentation generator • Free software released under the terms of the GNU General Public License • Developed by Dimitri van Heesch • (First version borrowed code from DOC++) • Initial release in the year of 1997 • Latest release 1.7.5.1 (August 2011) (This and the next 2 slides are prepared using the information in the wiki page listed Under References)
Operating systems supported: Unix , Linux, MAC OS, Windows (XP/ Vista/ 7) • Some common languages/scripting technologies not supported : VB, Perl, Ruby, Javascript, Tcl
Input & Output Input format Output format C, C++, C#, Java, Objective-C, Python, Fortran, VHDL, PHP HTML, Latex, RTF, XML, PostScript, PDF, MAN pages Doxygen
Doxywizard “GUI front end for configuring and running Doxygen.” [http://www.stack.nl/~dimitri/doxygen/doxywizard_usage.html]
Commands • Comment Java Code : /* This…. */ • For Doxygen, enclose commands within: /** This….. */ or /*! This….. */ Few simple Commands: @brief @param @return @enum <name of Enum> @mainpage @todo Find more commands in the folowing link http://www.stack.nl/~dimitri/doxygen/commands.html#cmdreturns
Demo Windows 7/Java/HTML (OS/Input format/Output format)
Sample code snippets with Doxygen commands package personal.trydoxygen; /**@mainpage Welcome * Home page in Doxygen documentation\n * ...\n * ...\n * ...\n * ...\n * ...\n * */ publicclass MainClass{ publicstaticvoid main(String[] args) { Mymathfunctions mathObj = new Mymathfunctions(); StringFunctions strObj = new StringFunctions(); } }
/*! * This method returns the sum of two integers. * @param a It is the first integer to be added. * @param b It is the second integer to be added. * @return The value returned is the sum of 2 arguments. * */ publicint sumInteger(int a,int b) { return a+b; }
Did you know? Answer: No Question 1: If I use “@mainpage” in more than 1 class(file), will the individual contents be joined in the documentation? C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/MainClass.java:12: warning: Compound personal::trydoxygen::MainClass is not documented. C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/Mymathfunctions.jav a:3: warning: found more than one \mainpage comment block! Skipping this block.
Question 2: If instead of @param, I mistype it as @params, what happens? public class Mymathfunctions { /*! * This method returns the sum of two integers. * @params a It is the first integer to be added. * @param b It is the second integer to be added. * @return The value returned is the sum of 2 arguments. * */ public int sumInteger(int a,int b) { return a+b; } }
Question 2 contd… Answer: That argument does not get documented. C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/Mymathfunctions.java:11: warning: Found unknown command `\params' C:/EclipseWorkspace/DemoDoxygen/src/personal/trydoxygen/Mymathfunctions.java:10: warning: The following parameters of personal::trydoxygen::Mymathfunctions::sumInteger(int a, int b) are not documented: parameter 'a'
Can you spot any error? /** * This method returns the value on dividing one number with other number. * @param a It is the first argument of this method. * @param b It is the second argument of this method. * @return The value returned is the value obtained on dividing c by d. * */ public double divideIntegers(int c,int d) { double result; if(d!=0) result=c/d; else result=1000000.50; return result; }
No copy paste Errors… • We need to be careful when we write
Why did I choose this tool? Not because I have used it extensively for the past X years… • But because, • It is used in software industry • The first time I used this tool, I felt nice to have known • about it. I felt that it is a good piece of information to • share with you all. • Hope you guys liked it!!!
References 1) http://www.stack.nl/~dimitri/doxygen/ 2) http://en.wikipedia.org/wiki/Doxygen 1) http://www.stack.nl/~dimitri/doxygen/ 2) http://en.wikipedia.org/wiki/Doxygen