OSDC - Cheatsheet-Doxygen-2022 5 30

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Doxygen Cheat Sheet

Doxygen is a documentation generator.

Running Doxygen
doxygen Run Doxygen to create documentation from annotated code

doxygen -g Create a Doxygen template

doxygen -x Compare existing Doxyfile against the template file

Block Comments Line


/*! Start comment block (Qt style) //!

/** Start comment block (Javadoc style) ///

*/ End comment block

\<special-command> or @<special-command> Use special command within a


comment block
/*!
* A brief description of the foo() function
*
* This is a detailed description of the foo()
* function, which can span several lines.
*
* @param Description of the one argument named 'bar'
*/

void foo(int bar);

Groups
{@ Mark the beginning of a group (within a special comment block)

@} Mark the end of a group (within a special comment block)

@name Specify name of the group

Stephan Avenwedde CC BY-SA 4.0 Opensource.com


Doxygen Cheat Sheet

Special commands
@brief Mark a paragraph as the brief description.

@param[in/out] Describe the arguments of a function or method.

@tparam Template parameter.

@mainpage Mark a comment block as the main page (index.html).

@section Start a new section in a long comment block.

@subsection A section within a section.

@ref Create a reference to a named section, subsection, page or anchor.

@internal Generate when INTERNAL_DOCS=yes in Doxyfile. Useful for private class members.

Special commands for arbitrary positioning


@class Document a C++ class @struct C-struct

@union Document a union @enum Enumeration type

@fn Document a function @var Variable

@def Document a #define @typedef Type definition

@file Document a file @namespace Namespace

@package Document a Java package @interface IDL interface


/*! @fn size_t ByteStream::size() const
* @brief Returns the size of the used memory buffer
*
* The function behaves identically for both
* internal and external buffers.
*/

Stephan Avenwedde CC BY-SA 4.0 Opensource.com

You might also like