groups.h 2.5 KB

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