mtbkrdave
mtbkrdave

Reputation: 3010

Why does Doxygen documentation only appear for the last of multiple adjacent groups?

I'm trying to document several similar functions at once using Doxygen groups. I would like the functions to share the same documentation as shown in the example here.

// @{
//! @brief Some documentation
int func1(void);
int func2(void);
// @}

// @{
//! @brief Some other documentation
int func3(void);
int func4(void);
// @}

However, when I run doxygen, only the 2nd group displays the @brief message in the HTML output. Am I doing something wrong, or is this a potential bug?

Note, I am not trying to nest groups, which the doxygen documentation says is not allowed.

Upvotes: 3

Views: 1677

Answers (3)

Nick
Nick

Reputation: 28006

For this to work you need to have DISTRIBUTE_GROUP_DOC on in your config. And code specified as:

//@{
//! Same documentation for both members. Details ...
void func1InGroup1();
void func2InGroup1();
//@}

And if you want to name the grouped section:

//! @name Group name
//@{
//! Same documentation for both members. Details ...
void func1InGroup1();
void func2InGroup1();
//@}

Upvotes: 4

mtbkrdave
mtbkrdave

Reputation: 3010

Solved!

The documentation to be factored out for each function group must precede the opening braces:

//! @brief Some documentation
// @{
int func1(void);
int func2(void);
// @}

//! @brief Some other documentation
// @{
int func3(void);
int func4(void);
// @}

Upvotes: 3

Lindydancer
Lindydancer

Reputation: 26094

Just a thought: Doxygen is picky when it comes to whitespace. Make sure to use '//@{' and not '// @{'.

Upvotes: 0

Related Questions