Skip to content

Commit 3c8b235

Browse files
unicornxRbb666
authored andcommitted
doxygen: group examples in subpages
Doxygen examples are grouped on different pages so that you can easily link to pages of related types in the documentation. For example, macro examples have their own page, and function examples have their own page, which correspond to their own code examples, such as "macro.h" or "function.h". Signed-off-by: Chen Wang <[email protected]>
1 parent ed8d0bc commit 3c8b235

File tree

7 files changed

+84
-30
lines changed

7 files changed

+84
-30
lines changed

documentation/0.doxygen/example/include/enum.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,23 @@
1414
*
1515
* See
1616
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/enum.h">documentation/0.doxygen/example/include/enum.h</a>
17-
* for example.
17+
* for code example.
18+
*
19+
* See
20+
* <a href="./group__group__doxygen__example__enum.html">Doxygen Example of Enumeration</a>
21+
* for html output.
1822
*/
1923

2024
/**
21-
* @addtogroup group_doxygen_example
25+
* @defgroup group_doxygen_example_enum Doxygen Example of Enumeration
26+
*
27+
* @ingroup group_doxygen_example
28+
*
29+
* @brief Doxygen Example of Enumeration.
30+
*
31+
* @{
2232
*/
2333

24-
/** @{ */
25-
2634
/**
2735
* @brief Brief description of this enumeration
2836
*/

documentation/0.doxygen/example/include/groups.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@
2424
*
2525
* See
2626
* <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>
27-
* for example.
27+
* for code example.
28+
*
29+
* See
30+
* <a href="./group__group__doxygen__example__sub.html">Doxygen Example of Groups and Sub-Groups</a>
31+
* for html output.
2832
*
2933
* More information can be found in the Doxygen manual:
3034
* <a href="https://www.doxygen.nl/manual/grouping.html">Grouping</a>.
3135
*/
3236

3337
/**
34-
* @defgroup group_doxygen_example_sub Sub Group of Doxygen Example
38+
* @defgroup group_doxygen_example_sub Doxygen Example of Groups
3539
*
3640
* All members of this group will be displayed in one HTML page.
3741
*

documentation/0.doxygen/example/include/macro.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,31 @@
1010
* recommend putting documentation after members. See `DOXYGEN_EXAMPLE_CONST_A`
1111
* and `DOXYGEN_EXAMPLE_CONST_B` in
1212
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/macro.h">documentation/0.doxygen/example/include/macro.h</a>
13-
* for exmaple.
13+
* for code exmaple.
1414
*
1515
* - The other is to define macros with parameters. For this type of
1616
* macro, we recommend using a method similar to documenting for
1717
* functions, that is, writing comment block before the macro definition.
1818
* More details please see @ref page_howto_function
1919
* See `DOXYGEN_EXAMPLE_ABS` in
2020
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/macro.h">documentation/0.doxygen/example/include/macro.h</a>
21-
* for example.
21+
* for code example.
22+
*
23+
* See
24+
* <a href="./group__group__doxygen__example__macro.html">Doxygen Example of Macro</a>
25+
* for html output.
2226
*/
2327

24-
/**
25-
* @addtogroup group_doxygen_example
28+
/**
29+
* @defgroup group_doxygen_example_macro Doxygen Example of Macro
30+
*
31+
* @ingroup group_doxygen_example
32+
*
33+
* @brief Doxygen Example of Macro.
34+
*
35+
* @{
2636
*/
2737

28-
/** @{ */
29-
3038
#define DOXYGEN_EXAMPLE_CONST_A 100 /**< Description of macro const A */
3139
#define DOXYGEN_EXAMPLE_CONST_B 200 /**< Description of macro const B */
3240

documentation/0.doxygen/example/include/struct.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,23 @@
1818
*
1919
* See
2020
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/struct.h">documentation/0.doxygen/example/include/struct.h</a>
21-
* for example.
21+
* for code example.
22+
*
23+
* See
24+
* <a href="./group__group__doxygen__example__struct.html">Doxygen Example of Structure</a>
25+
* for html output.
2226
*/
2327

2428
/**
25-
* @addtogroup group_doxygen_example
29+
* @defgroup group_doxygen_example_struct Doxygen Example of Structure
30+
*
31+
* @ingroup group_doxygen_example
32+
*
33+
* @brief Doxygen Example of Structure.
34+
*
35+
* @{
2636
*/
2737

28-
/** @{ */
29-
3038
/**
3139
* @brief Brief description this structure
3240
*

documentation/0.doxygen/example/include/typedef.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,26 @@
2626
*
2727
* See
2828
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/typedef.h">documentation/0.doxygen/example/include/typedef.h</a>
29-
* for example.
29+
* for code example.
30+
*
31+
* See
32+
* <a href="./group__group__doxygen__example__typedef.html">Doxygen Example of Typedef</a>
33+
* for html output.
3034
*/
3135

3236
#include "struct.h"
3337
#include "enum.h"
3438

3539
/**
36-
* @addtogroup group_doxygen_example
40+
* @defgroup group_doxygen_example_typedef Doxygen Example of Typedef
41+
*
42+
* @ingroup group_doxygen_example
43+
*
44+
* @brief Doxygen Example of Typedef.
45+
*
46+
* @{
3747
*/
3848

39-
/** @{ */
40-
4149
/**
4250
* @typedef dogygen_example_struct_t
4351
* Alias of `struct dogygen_example_struct`.
@@ -49,7 +57,7 @@ typedef struct dogygen_example_struct dogygen_example_struct_t;
4957
typedef struct dogygen_example_struct_another dogygen_example_struct_another_t;
5058

5159
/**
52-
* @typedef doxygen_example_enum
60+
* @typedef doxygen_example_enum_t
5361
* Alias of `enum doxygen_example_enum`.
5462
*/
5563
typedef enum doxygen_example_enum doxygen_example_enum_t;

documentation/0.doxygen/example/include/union.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,23 @@
1414
*
1515
* See
1616
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/include/union.h">documentation/0.doxygen/example/include/union.h</a>
17-
* for example.
17+
* for code example.
18+
*
19+
* See
20+
* <a href="./group__group__doxygen__example__union.html">Doxygen Example of Union</a>
21+
* for html output.
1822
*/
1923

2024
/**
21-
* @addtogroup group_doxygen_example
25+
* @defgroup group_doxygen_example_union Doxygen Example of Union
26+
*
27+
* @ingroup group_doxygen_example
28+
*
29+
* @brief Doxygen Example of Union.
30+
*
31+
* @{
2232
*/
2333

24-
/** @{ */
25-
2634
/**
2735
* @brief Brief description of this union
2836
*/

documentation/0.doxygen/example/src/function.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,27 @@
4343
*
4444
* See
4545
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/src/function.c">documentation/0.doxygen/example/src/function.c</a>
46-
* for example.
46+
* for code example.
4747
*
48-
* <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/src/function.h">documentation/0.doxygen/example/src/function.h</a> is an example of the header file where we just declare the API without doxygen documentation.
48+
* See
49+
* <a href="./group__group__doxygen__example__function.html">Doxygen Example of Function</a>
50+
* for html output.
51+
*
52+
* @note <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0.doxygen/example/src/function.h">documentation/0.doxygen/example/src/function.h</a>
53+
* is just an example of the header file where we declare the API without
54+
* doxygen documentation.
4955
*/
5056

5157
/**
52-
* @addtogroup group_doxygen_example
58+
* @defgroup group_doxygen_example_function Doxygen Example of Function
59+
*
60+
* @ingroup group_doxygen_example
61+
*
62+
* @brief Doxygen Example of Function.
63+
*
64+
* @{
5365
*/
5466

55-
/** @{ */
56-
5767
/**
5868
* @brief Brief description for the function
5969
*

0 commit comments

Comments
 (0)