Doxygen

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
Doxygen
File:Doxygen.png
Developer(s) Dimitri van Heesch
Stable release 1.6.2 / December 30, 2009; 130350716 ago
Written in C++
Operating system Cross-platform
Type Documentation generator
License GNU General Public License
Website http://www.doxygen.org

Doxygen is a documentation generator for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors), Fortran, VHDL, PHP, C#, and to some extent D. It runs on most Unix-like systems, including Mac OS X, as well as on Windows. The first version of Doxygen borrowed some code of an old version of DOC++; later, the Doxygen code was rewritten by Dimitri van Heesch.

Doxygen is a tool for writing software reference documentation. 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.

Doxygen is released under the terms of the GNU General Public License. Doxygen is free software.

Contents

Usage

Like Javadoc, Doxygen extracts documentation from source file comments. In addition to the Javadoc syntax, Doxygen supports the documentation tags used in the Qt toolkit and can generate output in HTML as well as in CHM, RTF, PDF, LaTeX, PostScript or man pages.

Example code

File:Doxygen ouput.png
A screenshot of what the output would look like in HTML.

The generic syntax of documentation comments is to label the comments with two star-characters:

/**
 * <A short one line description>
 *
 * <Longer description>
 * <May span multiple lines or paragraphs as needed>
 *
 * @param  Description of method's or function's input parameter
 * @param  ...
 * @return Description of the return value
 */

The following illustrates how a C++ source file can be documented. Make sure the parameter EXTRACT_ALL in the Doxyfile is set to YES.

/**
 * @file
 * @author  John Doe <jdoe@example.com>
 * @version 1.0
 *
 * @section LICENSE
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @section DESCRIPTION
 *
 * The time class represents a moment of time.
 */
 
class Time {
 
    public:
 
       /**
        * Constructor that sets the time to a given value.
        * 
        * @param timemillis Number of milliseconds 
        *        passed since Jan 1, 1970.
        */
       Time (int timemillis) {
           // the code
       }
 
       /**
        * Get the current time.
        *
        * @return A time object set to the current time.
        */
       static Time now () {
           // the code
       }
};

An alternative approach that is preferred by some for documenting parameters is shown below. It will produce the same documentation.

       /**
        * Constructor that sets the time to a given value.
        * 
        */
       Time (int timemillis ///< Number of milliseconds passed since Jan 1, 1970.
            ) 
       {
           // the code
       }

Richer markup is also possible. For instance, add equations using LaTeX commands:

/**
 *
 * An inline equation @f$ e^{\pi i}+1 = 0 @f$ 
 * 
 * A displayed equation: @f[ e^{\pi i}+1 = 0 @f]
 *
 */

See also

External links

de:Doxygen es:Doxygen fr:Doxygen id:Doxygen it:Doxygen nl:Doxygen ja:Doxygen pl:Doxygen ru:Doxygen sr:Доксиџен zh:Doxygen

Personal tools

Served in 0.247 secs.