1
0

groups.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef _DOXYGEN_EXAMPLE_GROUPS_H_
  2. #define _DOXYGEN_EXAMPLE_GROUPS_H_
  3. /**
  4. * @page page_howto_groups How to use groups in doxygen documentation.
  5. *
  6. * Doxygen has three mechanisms to group things together. For RT-Thread
  7. * API documentation, we use 'topics' to create new page for each group.
  8. * On HTML browser, the topics pages are shown under the "Modules" in the
  9. * treeview on the left.
  10. *
  11. * To define a group, we use `@defgroup` command. The group name should be
  12. * prefixed with a "group_", and the group name should be unique. We can
  13. * define a group anywhere, not necessarily in the same file as the members
  14. * of the group. Generally, we define a group in a header file.
  15. *
  16. * To make an entity (structure, function etc. or another group) a member of
  17. * a speicific group, we can use `@ingroup` command and put the `@ingroup`
  18. * command inside its documentation block.
  19. *
  20. * To avoid putting `@ingroup` commands in the documentation for each member
  21. * you can use `@addtogroup` and group members together by the open marker
  22. * `@{` before the group and the closing marker `@}` after the group.
  23. *
  24. * See
  25. * <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/groups.h">documentation/0.doxygen/example/include/groups.h</a>
  26. * for example.
  27. *
  28. * More information can be found in the Doxygen manual:
  29. * <a href="https://www.doxygen.nl/manual/grouping.html">Grouping</a>.
  30. */
  31. /**
  32. * @defgroup group_doxygen_example_sub Sub Group of Doxygen Example
  33. *
  34. * All members of this group will be displayed in one HTML page.
  35. *
  36. * @ingroup group_doxygen_example
  37. *
  38. * @brief Define a sub group of Doxygen Example.
  39. */
  40. /**
  41. * @brief Brief description of this enumeration
  42. *
  43. * We use `@ingroup` to add this enum to the group_doxygen_example_sub separately.
  44. *
  45. * @ingroup group_doxygen_example_sub
  46. */
  47. enum doxygen_example_enum_2
  48. {
  49. V1, /**< description for value 1 */
  50. V2, /**< description for value 2 */
  51. };
  52. // This entity is not a member of any group.
  53. #define DOXYGEN_EXAMPLE_CONST_E 300 /**< Description of macro const D */
  54. /**
  55. * @addtogroup group_doxygen_example_sub
  56. */
  57. /** @{ */
  58. /*
  59. * DOXYGEN_EXAMPLE_CONST_C & DOXYGEN_EXAMPLE_CONST_D are close together, so
  60. * we can use `@addtogroup`, `@{` and `@}` to group them together.
  61. */
  62. #define DOXYGEN_EXAMPLE_CONST_C 100 /**< Description of macro const C */
  63. #define DOXYGEN_EXAMPLE_CONST_D 200 /**< Description of macro const D */
  64. /** @} */
  65. #endif /* _DOXYGEN_EXAMPLE_GROUPS_H_ */