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 (\) 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. This allows for an alternative approach for documenting parameters as shown below. /*
* *
Function description */ void foo(int p1 /** /** * An inline equation @f$ e^{\pi i}+1 = 0 @f$ * A displayed equation: @f[ e^{\pi i}+1 = 0 @f] */ A more complete example in C++: /** * @file Time.cpp * @module org.wikipedia.util.Time * @brief Time class * @author John Doe * @version 1.0 * @copyright CC BY-SA or GFDL * @sa Wikipedia:Copyrights - Wikipedia */ export module org.wikipedia.util.Time; import org.wikipedia.core; import org.wikipedia.util.Date; using org::wikipedia::core::ISerializable; /** * @namespace org::wikipedia::util * @brief A namespace of utility classes */ export namespace org::wikipedia::util { /** * @class Time * @brief Represents a moment of time * @author John Doe * * The class Time represents the amount of time elapsed * since the UNIX epoch. * * @extends Date * @implements ISerializiable */ class Time : public Date, public ISerializable { private: int64_t millis; /// == See also ==