Doxygen


Doxygen is a documentation generator, 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.
Doxygen is free software, released under the terms of the GNU General Public License version2.

Design

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 HyperText Markup Language as well as in Microsoft Compiled HTML Help, Rich Text Format, Portable Document Format, LaTeX, PostScript or man pages.

Uses

s supported by Doxygen include C, C++, C#, D, Fortran, IDL, Java, Objective-C, Perl, PHP, Python, Tcl and VHDL. Other languages can be supported with additional code.
Doxygen runs on most Unix-like systems, macOS, and Windows.
The first version of Doxygen borrowed code from an early version of DOC++, developed by Roland Wunderling and Malte Zöckler at Zuse Institute Berlin. Later, the Doxygen code was rewritten by Dimitri van Heesch.
Doxygen has built-in support to generate inheritance diagrams for C++ classes. For more advanced diagrams and graphs, Doxygen can use the "dot" tool from Graphviz.

Example code

The generic syntax of documentation comments is to start a comment with an extra asterisk after the leading comment delimiter '/*':

/**



@param Description of method's or function's input parameter
@param ...
@return Description of the
return value
  • /

Many programmers like to mark the start of each line with space-asterisk-space, as follows, but that is not necessary.

/**
*
*
*
*
*
* @param Description of method's or function's input parameter
* @param ...
* @return Description of the return value
*/

Many programmers avoid using C-style comments and instead use C++ style
single line comments. Doxygen accepts comments with additional slash as Doxygen comments.

///
///
///
///
///
/// @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.

/**
* @file
* @author
John Doe
* @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 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
* https://www.gnu.org/copyleft/gpl.html
*
* @section DESCRIPTION
*
* The time class represents a moment of time.
*/
class Time ;

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

/**
* Constructor that sets the time to a given value.
*/
Time


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

/**
*
* An inline equation @f$ e^+1 = 0 @f$
*
* A displayed equation: @f
*
*/

Doxygen source and development

The Doxygen sources are currently hosted at GitHub, where the main developer, Dimitri van Heesch, contributes under the user name "doxygen". Doxygen is written in C++, and comprises over 300,000 source lines of code. For lexical analysis, the standard tool Lex is run on over 35,000 lines of lex script. The parsing tool Yacc is also used, but only for minor tasks; the bulk of language parsing is done by native C++ code. The build process is based on CMake and also involves some Python scripts.