简体   繁体   中英

Group level documentation for preprocessor defines in Doxygen

I have a C/C++ header file that defines multiple groups of preprocessor symbols. Each of these groups should have its own documentation at the group level, and one-line documentation for each symbol in the group.

I establish the groups using defgroup/addtogroup, and each group nicely show up in the Modules tab with the desired symbols in it.

What I could not achieve is the documentation at the group level. Whatever I have tried, the group level documentation shows up, but as a documentation of the first symbol of the group.

For example:

/**
 * @defgroup group-1 Preprocessor symbols group 1
 * @{
 */
/**
 * @brief Brief description of group 1.
 *
 * Long description of group 1.
 */
#define GROUP1_SYM1 1  ///< Meaning of symbol 1
#define GROUP1_SYM2 2  ///< Meaning of symbol 2
/**
 * @}
 */

In the output, the module page for the group has an empty "Detailed Description" section, and the entry for GROUP1_SYM1 in the "Macro Definition Documentation" section contains:

Brief description of group 1.
Long description of group 1.
Meaning of symbol 1

What I would like to achieve is that the brief description shows up at the top of the module page for the group, the long description shows up in section "Detailed Description", and each symbol's description has only the one-line description stated in the code.

I also tried adding @{ and @} around the group of #define statements, but that did not change anything.

I did review Documenting preprocessor defines in Doxygen , but while it shows how to group preprocessor symbol definitions, it does not have a group-level description (other than the group title).

I am using doxygen 1.8.6 on Ubuntu 14.04.

Put the documentation for the group in the group definition, not below it in the list of members:

/**
 * @defgroup group-1 Preprocessor symbols group 1
 * 
 * @brief Brief description of group 1.
 *
 * Long description of group 1.
 */

/**
 * @addtogroup group-1
 * @{
 **/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM