groups.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 code example.
  27. *
  28. * See
  29. * <a href="./group__group__doxygen__example__sub.html">Doxygen Example of Groups and Sub-Groups</a>
  30. * for html output.
  31. *
  32. * More information can be found in the Doxygen manual:
  33. * <a href="https://www.doxygen.nl/manual/grouping.html">Grouping</a>.
  34. */
  35. /**
  36. * @defgroup group_doxygen_example_sub Doxygen Example of Groups
  37. *
  38. * All members of this group will be displayed in one HTML page.
  39. *
  40. * @ingroup group_doxygen_example
  41. *
  42. * @brief Define a sub group of Doxygen Example.
  43. */
  44. /**
  45. * @brief Brief description of this enumeration
  46. *
  47. * We use `@ingroup` to add this enum to the group_doxygen_example_sub separately.
  48. *
  49. * @ingroup group_doxygen_example_sub
  50. */
  51. enum doxygen_example_enum_2
  52. {
  53. V1, /**< description for value 1 */
  54. V2, /**< description for value 2 */
  55. };
  56. // This entity is not a member of any group.
  57. #define DOXYGEN_EXAMPLE_CONST_E 300 /**< Description of macro const D */
  58. /**
  59. * @addtogroup group_doxygen_example_sub
  60. */
  61. /** @{ */
  62. /*
  63. * DOXYGEN_EXAMPLE_CONST_C & DOXYGEN_EXAMPLE_CONST_D are close together, so
  64. * we can use `@addtogroup`, `@{` and `@}` to group them together.
  65. */
  66. #define DOXYGEN_EXAMPLE_CONST_C 100 /**< Description of macro const C */
  67. #define DOXYGEN_EXAMPLE_CONST_D 200 /**< Description of macro const D */
  68. /** @} */
  69. #endif /* _DOXYGEN_EXAMPLE_GROUPS_H_ */