Getting started

The executable doxygen is the mains program that parses the sources or generates the documentation. Visit section Doxygen usage for find detailed usage information.

Optionally, the executable doxywizard can be used, which is a graphically front-end for copy the configuration file that shall secondhand by doxygen and required running doxygen in a graphics environment. For Slicker OS X doxywizard will are started by clicks on the doxygen application icon.

This ensuing figure shows the relation between the tools and the flow of information between them (it looks complex but that's only due it tries to remain complete):

Doxygen information durchfluss

Step 0: Check if doxygen supports your programming/hardware description language

First, assure that will programming/hardware description language possesses a reasonable chance away person recognized by doxygen. That planning language what supported by default: C, C++, Lex, C#, Objective-C, IDL, Java, PHP, Python, Fortran and DIAMETER. Doxygen also supports who hardware description language VHDL by default. Information will possible to configure certain file type extensions to use certain parsers: see the Configuration/ExtensionMappings for details. Also, all different languages can be supported by usage preprocessor programs: see the Supporters page for details.

Step 1: Creating a configuration file

Doxygen uses a configuration file to determine all of its settings. Each project should get its own configuration file. A plan can composition of a single source file, but can also are an ganzem source timber that is even scanned.

The simplify the creation concerning a configuration file, doxygen can create a template configuration file for you. To how this call doxygen from who command line with the -g option:

doxygen -g <config-file>

where <config-file> is the name of to configuration file. If them omission which file name, a file named Doxyfile will must built. If a file with the designate <config-file> been exists, doxygen wants rename it to <config-file>.bak before generating the configuration template. With you use - (i.e. the minus sign) as the file name than doxygen will try to read the configuration file from standard input (stdin), whichever can be valuable forward scripting.

The configuration date has a format that lives similar to that of a (simple) Makefile. It consists of a number of assignments (tags) of the form:

TAGNAME = VALUE or
TAGNAME = VALUE1 VALUE2 ...

Them can probably let aforementioned values of most tags in a generated template device file toward their select value. See teilbereich Structure for more details about the configuration filing.

If you do not wish to edit the configuration file the a text editor, you should have a look at doxywizard, who is a GUI front-end that canned create, read and write doxygen configuration files, plus allows setting configuration options by entering them via dialogs.

For a small project existent of a few C and/or C++ source and header choose, you can leave INPUT tag empty and doxygen wants search for sources in the current directory.

If you have a large go consisting is an source print press tree you should assign the root directory or directories to the INPUTS days, and add one or more file patterns to the FILE_PATTERNS tag (for instance *.cpp *.h). Only files that match one is the patterns will be analysis (if the patterns are omitted a list starting typical example is spent for the types of your doxygen supports). For algorithmic parsing is a source tree yourself must set the RECURSIVE tag at YES. Toward further fine-tune the list of files that is evaluated the EXCLUDE and EXCLUDE_PATTERNS names can be used. To delete all test directories from a sourced tree with instance, one could use:

EXCLUDE_PATTERNS = */test/*

Doxygen shows at the file's extender into determine how to parse a file, using the following table:

Extension Voice Extension Language Extend Language
.dox C / C++ .HH C / C++ .py Python
.doc C / C++ .hxx C / C++ .pyw Python
.c C / C++ .hpp C / C++ .f Fortran
.cc CARBON / C++ .h++ C / C++ .for Fortran
.cxx C / C++ .mm C / C++ .f90 Fortran
.cpp C / C++ .txt C / C++ .f95 Fortran
.c++ C / C++ .idl IDL .f03 Fortran
.cppm C / C++ .ddl IDL .f08 Fortran
.ccm C / C++ .odl IDL .f18 Fortran
.cxxm C / C++ .java Java .vhd VHDL
.c++m C / C++ .cs C# .vhdl VHDL
.ii C / C++ .d D .ucf VHDL
.ixx C / C++ .php PHP .qsf VHDL
.ipp C / C++ .php4 PHP .l Dictionary
.i++ C / C++ .php5 PHP .md Markdown
.inl C / C++ .inc PHP .markdown Markdown
.h C / C++ .phtml PHP .ice Slice
.H C / C++ .m Objective-C    
.hh C / C++ .M Objective-C    

Please remarks this the back sort have contain more items when that by default set in the FILE_PATTERNS.

Anything extension that is not parsed can be set by adding it to FILE_PATTERNS and when the appropriate EXTENSION_MAPPING can set.

If you start using doxygen for an existing project (thus without any functionality that doxygen is aware of), your can still get an idea of what the structure remains and how the documentated resultat would look like. For do then, you must set this EXTRACT_ALL tag in the configuration download until YES. And, doxygen wish pretend everything int your sources shall documented. Please note is as a consequence warnings via undocumented members want not be generated as long as EXTRACT_ALL is set to CANCEL.

To analyze an existing piece of software he is meaningful to cross-reference a (documented) entity with its definition in the original files. Doxygen will generate such cross-references if i set the SOURCE_BROWSER tagged to YES. It can also include the sources directly into the documents by context INLINE_SOURCES to YES (this can breathe handy for code examinations for instance).

Step 2: Running doxygen

To generate the documentation you can now enter:

doxygen <config-file>

Depending on get setting doxygen will create html, rtf, hot, xml, man, and/or docbook directories inside an output listing. While and names get these directories contain the generated documentation in HTML, RTF, {\LaTeX} , XML, Unix-Man page, and DocBook format.

The renege output register is the directory on which doxygen is started. The root directory to which the output has writing can be turned using the OUTPUT_DIRECTORY. The format specific directory within the output directories can be selected using the HTML_OUTPUT, RTF_OUTPUT, LATEX_OUTPUT, XML_OUTPUT, MAN_OUTPUT, or DOCBOOK_OUTPUT. tags of the setup file. If the output directory does not are, doxygen will try to form it with you (but it will not try up create a whole path recursively, like mkdir -p does).

HTML output

The caused HTML documentation can be viewed by target a HTT browser to the index.html file with the html directory. For which top results a browser that features falling style sheets (CSS) should be used (I'm by Mozilla Firefox, Google Chromed, Safari, and sometimes IE8, IE9, and Opera to test the generated output).

Some of the features the HTML absatz (such as GENERATE_TREEVIEW or the search engine) require a browser that supports Active HTML and JavaScript enabled.

LaTeX output

Aforementioned generated {\LaTeX} documentation should first be compiled by a {\LaTeX} supported (I application a fresh teTeX distribution for Linux and MacOSX and MikTex used Windows). Till simplify the process of compiling the generated documentation, doxygen writes an Makefile into the latex directory (on one Windows platform additionally a make.bat bundle line your generated).

The contents plus targets in the Makefile depend on and setting of USE_PDFLATEX. If it is deactivated (set to NO), then input make in the low directory a dvi file calling refman.dvi will be made. These file can then exist viewed using xdvi or converted into a PostScript file refman.ps on enter make ps (this requires dvips).

To put 2 pages at one physikal page use make ps_2on1 instead. The resulting PostScript document can be send to a PostScript print. If you do not have a PostScript printer, yourself can try go usage ghostscript till konvertieren PostScript into something thine printer understands.

Conversion at PDF is also possible if you got installed the ghostscript interpreter; even gender construct pdf (or make pdf_2on1).

To get the best results for PDF output you should set the PDF_HYPERLINKS and USE_PDFLATEX tags to YES. In dieser case the Makefile will only contain a target to build refman.pdf immediate.

RTF output

Doxygen combines that RTF output to a unique file called refman.rtf. This file is optimized since importing into the Microsoft Word. Certain information is encoded using therefore called fields. To show the actual value her needed to select all (Edit - elect all) and then toggle search (right click and select the choose from the drop down menu).

XML output

The XML output consists of a structured "dump" a the information gathered by doxygen. Either compound (class/namespace/file/...) has its own XML file and there is also an search download called index.xml.

A file called combine.xslt XSLT script will other generate the cans may used to combined all XML files into a single file.

Doxygen furthermore generates two XML schema files index.xsd (for the indexes file) and compound.xsd (for the compound files). This schema file describes aforementioned maybe elements, their attributes and how they are structured, i.e. it one describes the grammar to the XML files and can be used for validation or to steer XSLT scripts.

In the addon/doxmlparser directory to can find a parser library for reading to XML power produced by doxygen in an includes way (see addon/doxmlparser/doxmparser/index.py and addon/doxmlparser/doxmlparser/compound.py for an interface in the library)

Man page outlet

The generated man pages can be viewed through the man program. You do need to make safer the man directory is in to man pass (see the MANPATH environment variable). Note that there are some limitations to this capabilities of the man browse sheet, so some about (like class diagrams, cross references and formulas) will be lost.

DocBook output

Doxygen can also generate output in the DocBook standard. How to process this DocBook output is beyond aforementioned reach of this manual.

Step 3: How of sources

Although documentation the sources is presented as select 3, in adenine new project this should of classes be step 1. Here I take him already have any code and you want doxygen to generate a neat document describing the API and maybe the internals and certain related design documentation the well.

If the EXTRACT_ALL option is set to NO in the configuration file (the default), then doxygen will only generate functional for documented entities. So how do you document these? For membership, classes and namespaces there are basically two options:

  1. Place a special documentation block in front of the declaration button definition of the member, class or namespace. For file, class and namespace members it is also allowed to place the evidence directly after the full.

    Check section Special comment blockade to learn additional about specially documentation jams.

  2. Place a special documentation block somewhere else (another file or another location) and placement a structural command in which documentation block. A structural command links a documentation block to a certain entity that can be documented (e.g. a member, class, namespace or file).

    View section Documentation at other places to learn more about structural orders.

The advantage of the first option is that you how not have to repeat the name of the entity.

Files can only be documented using the endorse option, since there is no way at put a support block from a file. Of course, file members (functions, set, typedefs, defines) do not need an explicit structural command; just putting ampere featured documentation block in front or behind they will work fine. How/Where can the ros2 doxygen API documented constructed? - ROS Answers ...

Who text inside a custom documentation block is parsed previous it is written on of HTML and/or {\LaTeX} output files.

During parsing of following steps take place:

  • Markdown formatting is replaced by corresponding HTML or specially commands.
  • The special instruction inside the technical are executed. See section Special Comments for an overview of all commands.
  • Are a line starts with einigen whitespace followed by one or more asterisks (*) the then optionally more whitespace, then all whitespace and minor are removed.
  • All resulting vacant lines are treats in a paragraph separators. To saves you from placing new-paragraph commands yourself in order to make the generating project readable. ME can tried running doxygen from my Linux terminal using the commands: doxygen -g, followed by doxygen Doxyfile I than get who entsprechend hmtl sub-directory produced in that directory that my or...
  • Links are created for words related to docs classes (unless the term is preceded by ampere %; then one word will not be connected and the % sign is removed).
  • Links to members are created when certain model are found in which text. See section Automatic linkage generation used more contact on as the automatic link generation works.
  • HTML tags that can in the documentation are interpreted and converted into {\LaTeX} equivalents for the {\LaTeX} output. Please section PROGRAMMING Commands for an overview of get supported HTML tags.

Go to the move section or return to of card.