4

I am creating a Doxygen document for my project. Recently, I have grouped related classes using \addtogroup tag. After this, I have got a module tab in my documentation. It shows all modules. I want to add some description right below module name below the module name on the same page. How can I do it using Doxygen ?

Here's my tag

/*! \addtogroup test test
 *  Test Testing a group in doxygen
 *  @{
 */
phoenix
  • 7,988
  • 6
  • 39
  • 45
cppdev
  • 6,833
  • 13
  • 40
  • 45

1 Answers1

19

You have to write a dedicated .h file which contains only comments. For each group you define a comment like this:

/** @defgroup FooGroup
 *
 * This module does yada yada yada
 *
 */

Then you assign definition to the group (even on different files) like this:

/** @addtogroup FooGroup */
/*@{*/

/** Summon a goat
 *
 * @param name The name of the goat;
 * @return The summoned goat;
 */
Goat summon_goat (const char *name);

...
...

/*@}*/

EDIT:

Also this is how it becomes. See the "Detailed Description"? You can also add code snippet and examples within the @verbatim and @endverbatim commands.

Dacav
  • 13,590
  • 11
  • 60
  • 87
  • 7
    "Summon a goat" cracked me up. By the way, the SourceForge link seems to be broken as of Sept 28, 2011. – Adrian Sep 28 '11 at 20:43
  • Note that you do not need a separate header file to do this. You can put the `@defgroup` in the same file as the `@addtogroup`s, or not have a `@defgroup` at all and just put the text into one of the `@addtogroup` blocks (they work the same as `@defgroup` for this). The trick is that in order for text to show up at the top of the module's page (and in the module index page) it needs to be the brief description (i.e. `@brief`), while anything else will show up under "Detailed Description" further down. – Foogod Dec 21 '15 at 23:53
  • I see this answer is aged - but still was the answer to what I just googled for. Too bad that your example link seems to be rotten. Could you insert it into the page as [snippet](https://meta.stackoverflow.com/questions/269753/feedback-requested-runnable-code-snippets-in-questions-and-answers)? – Scheff's Cat Oct 07 '20 at 06:28