HOME

TheInfoList



OR:

Doxygen ( ) is a documentation generator that works with many
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s. It extracts information from specially-formatted
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
comments and saves the information in one of various supported formats. Doxygen supports static analysis of a
codebase In software development, a codebase (or code base) is a collection of source code used to build a particular software system, application, or software component. Typically, a codebase includes only human-written source code system files; thu ...
. It uses the
parse tree A parse tree or parsing tree (also known as a derivation tree or concrete syntax tree) is an ordered, rooted tree that represents the syntactic structure of a string according to some context-free grammar. The term ''parse tree'' itself is use ...
parsed from the codebase to generate diagrams and charts of the code structure. It provides cross-referencing that a reader can use to refer back to the source code from the generated documentation. Doxygen can be used in many programming contexts. It supports many languages including C, C++, C#, D, Fortran, IDL,
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
,
Objective-C Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style message passing (messaging) to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was ...
,
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
, PHP, Python, and
VHDL VHDL (Very High Speed Integrated Circuit Program, VHSIC Hardware Description Language) is a hardware description language that can model the behavior and structure of Digital electronics, digital systems at multiple levels of abstraction, ran ...
. It can run on many computers, including
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
,
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
, and
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
systems. It is
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
, released under the terms of the GNU General Public License version2 (GPLv2).


History

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.


Development

The Doxygen source code is hosted at
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
, where the main developer, Dimitri van Heesch, contributes under the name "doxygen". Doxygen is written in C++, and consists of around 300,000 source lines of code. For
lexical analysis Lexical tokenization is conversion of a text into (semantically or syntactically) meaningful ''lexical tokens'' belonging to categories defined by a "lexer" program. In case of a natural language, those categories include nouns, verbs, adjectives ...
, Lex (or its replacement Flex) is run via approximately 35,000 lines of lex script. The
parsing Parsing, syntax analysis, or syntactic analysis is a process of analyzing a String (computer science), string of Symbol (formal), symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal gramm ...
tool
Yacc Yacc (Yet Another Compiler-Compiler) is a computer program for the Unix operating system developed by Stephen C. Johnson. It is a lookahead left-to-right rightmost derivation (LALR) parser generator, generating a LALR parser (the part of a co ...
(or its replacement Bison) is also used, but only for minor tasks. The bulk of parsing is done via native C++ code. The build system includes CMake and Python script.


Design

Like other documentation generators such as
Javadoc Javadoc (also capitalized as JavaDoc or javadoc) is an API documentation generator for the Java programming language. Based on information in Java source code, Javadoc generates documentation formatted as HTML and other formats via extensions. ...
, Doxygen extracts information from both the comment and the symbolic (non-comment) code. A comment is associated with a programming symbol by immediately preceding it in the code. Markup in the comments allows for controlling inclusion and formatting of the resulting documentation. Doxygen supports output in many formats including:
HTML Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
, CHM, RTF,
PDF Portable document format (PDF), standardized as ISO 32000, is a file format developed by Adobe Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
,
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well. In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
,
PostScript PostScript (PS) is a page description language and dynamically typed, stack-based programming language. It is most commonly used in the electronic publishing and desktop publishing realm, but as a Turing complete programming language, it c ...
and man page. Doxygen can generate inheritance diagrams for
C++ classes A class in C++ is a user-defined type or data structure declared with any of the keywords class, struct or union (the first two are collectively referred to as non-union classes) that has data and functions (also called member variables and me ...
. For more advanced diagrams and graphs, Doxygen can use the "dot" tool from
Graphviz Graphviz (short for ''Graph Visualization Software'') is a package of open-source software, open-source tools initiated by AT&T Labs, AT&T Labs Research for Graph drawing, drawing graph (discrete mathematics), graphs (as in Vertex (graph theory ...
.


Example

All examples are given for languages with C-like comments where a multi-line comment starts with /* and a single line comment starts with //. Doxygen ignores a comment unless it is marked specially. For a multi-line comment, the comment must start with /** or /*!. A markup tag is prefixed with a
backslash The backslash is a mark used mainly in computing and mathematics. It is the mirror image of the common slash (punctuation), slash . It is a relatively recent mark, first documented in the 1930s. It is sometimes called a hack, whack, Escape c ...
(\) or an at-sign (@). The following is a relatively simple function comment block with markup in bold: /** ''Function description'' @param ''p1 Parameter description'' @param ''p2 Parameter description'' @return ''Return description'' */ void foo(int p1, int p2) A block can be formatted various ways. A common way is to left-align asterisks on each line which Doxygen does not include in the output. For example: /** * ''Function description'' * @param ''p1 Parameter description'' * @param ''p2 Parameter description'' * @return ''Return description'' */ void foo(int p1, int p2) Alternatively, a block can consist of a series of single-line comments. Doxygen accepts comments with an additional slash (/) or exclamation (!). /// ''Function description'' /// @param ''p1 Parameter description'' /// @param ''p2 Parameter description'' /// @return ''Return description'' void foo(int p1, int p2) To locate a documentation comment to the right of the code, an additional < marker is required.Doxygen: Documenting the code - §Putting documentation after members
/ref> This allows for an alternative approach for documenting parameters as shown below. /** * ''Function description'' */ void foo(int p1 /**LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latices are found in nature, but synthetic latices are common as well. In nature, latex is found as a wikt:milky, milky fluid, which is present in 10% of all floweri ...
commands. For example: /** * An inline equation @f$ e^+1 = 0 @f$ * A displayed equation: @f e^+1 = 0 @f */ A more complete example in C++: /** * @file * @brief Time class header * @author John Doe * @version 1.0 * @copyright CC BY-SA or GFDL * @sa Wikipedia:Copyrights - Wikipedia */ /** * Represents a moment of time * @author John Doe */ class Time ;


See also

* Comparison of documentation generators * API Writer


References


External links

* {{official website Code navigation tools Cross-platform software Free computer programming tools Free documentation generators Free software programmed in C++ Software that uses Qt