Doxygen: Difference between revisions

From miki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Reference ==
== Reference ==
* https://www.doxygen.nl/manual/
* https://www.doxygen.nl/manual/
:* https://www.doxygen.nl/manual/lists.html


== Reference ==
== Reference ==
Line 59: Line 60:
=== Format ===
=== Format ===
* Use <code>#variable</code> to create a link to ''variable'', or anything that can be referenced.
* Use <code>#variable</code> to create a link to ''variable'', or anything that can be referenced.
<source>
<source lang="c">
/**
/**
* @param[in] beans Pointer to the bag of beans.
* @param[in] beans Pointer to the bag of beans.
* @param[in] count Number of #beans to take.
* @param[in] count Number of #beans to take.
*/
</source>

* Use <code>\b bold_text</code> to put the next word in bold
<source lang="c">
/**
* @file
*
* @brief Contains \b only important things.
*/
*/
</source>
</source>

Latest revision as of 00:52, 11 July 2021

Reference

Reference

One-liner

Documentation block are usually added before the item to document. Use /** ... */ or ///:

/** Brief description which ends at this dot. Details follow
 *  here.
 */
uint8_t my_int;

/// Brief description which ends at this dot. Details follow
/// here.
uint8_t my_other_int;

Documentation can also be added after members.

int var; /*!< Detailed description after the member */ 

int var; /**< Detailed description after the member */

int var; //!< Detailed description after the member
         //!< 

int var; ///< Detailed description after the member
         ///<

Most often one only wants to put a brief description after a member. This is done as follows:

int var; //!< Brief description after the member

int var; ///< Brief description after the member

Functions

Typical function comment block:

/** 
 * @brief Make coffee.
 * 
 * Brew coffee with the given beans.
 *
 * @param[in]  beans  Pointer to the bag of beans.
 * @param[in]  count Number of beans to take.
 * @param[out] pot   Pointer to the coffee pot, where coffee will be loaded.
 *
 * @return     The quantity of brewed coffee.
 */
int brew_coffee(void * beans, int count, void * pot);

Format

  • Use #variable to create a link to variable, or anything that can be referenced.
/** 
 * @param[in]  beans  Pointer to the bag of beans.
 * @param[in]  count  Number of #beans to take.
 */
  • Use \b bold_text to put the next word in bold
/**
 * @file
 *
 * @brief     Contains \b only important things.
 */

Tips

Link to Main Page

Use /ref index [1]:

/**
 * See \ref index.
 */