问题
I have a question about pages and groups in doxygen. I have a project, where I grouped classes etc. with the @defgroup and @ingroup cmds. So far this works fine.
Now I'd like to add special documentation to the project with markdown pages. These pages should appear in the dedicated module (group). I tried to create pages with the @page and @subpage cmds. That works fine, but the pages appear plain in the menu.
So I tried to add them to the groups with @ingroup. But that doesn't work as I guessed. Is it possible to add pages to modules (groups)?
The result should look like this:
Project
|-- Modules
| |-- "Module1"
| | |-- documentation page1 (from *.md file)
| | |-- class documentation
| |-- "Module2"
| | |-- documentation page2
| | |-- class documentation
I hope you can help me!
回答1:
In described case we have two types of documentation for groups:
- documentation from source files
- documentation from markdown files
And we need create tree structure for this goups.
For example, we create 2 groups :
- Main Application with documentation in source code
- Library with documentation in file library.md
Main Application group source code (for C++) may look like this:
/** @defgroup app Main Application */
/** @addtogroup app
* @brief Main application description.
*
* @{
*/
int main() { return 0; } //do nothing
/** @} */
MarkDown file library.md contain simple text:
Library File {#library}
============
Library Page Content from library.md.
Now to define structure we create mainpage.md file with content:
Pages {#mainpage}
============
Content:
- @subpage library
@defgroup Library
@addtogroup Library
@copydoc library
@{
@}
@subpage
tag in mainpage.md used to hide all pages from tree to one root item (Pages).
@defgroup
tag create new group for markdown documentation.
@copydoc
tag copy content from library page to Library group.
On screenshot you can see result structure:
Note, that Module Group name and Page name may be different in that case. You can also paste content from MarkDown files into source code documentation using @copydoc
tag.
Reference: http://www.doxygen.nl/manual/grouping.html
回答2:
I have done it using @{ and @} commands and it works like this -
/**
* @defgroup module_name Sample Module
* @{
* @page page_name [Optional Page Heading]
* here will be the texts for the page ...
* @}
*/
If you have the module already defined some where, probably you need to use @addtogroup instead of @defgroup.
Hope this helps.
来源:https://stackoverflow.com/questions/15202909/doxygen-grouping