-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doxygen: @ingroup does not support braces #20537
Comments
are you sure that's what is happening? i think there is a difference between group ( and membergroups we can have a member group inside a group but opening a member group cancels automatic membergroups |
|
I just added steps to reproduce. I think it should prove that our use of nesting is breaking things. This isn't the best example in that we probably actually are okay with the outputted doc in this case, but it is the example I have in-front of me and understand best at this time. |
Another ancillary thing I noticed is that there seems to be alot of misunderstanding surrounding use of the member groups exacerbated by copy-pasting. I'm not actually sure that the member group used here does anything. The purpose of member groups is to group multiple doc blocks together, but the group is opened and closed in the same block. So nothing is actually grouped. |
I believe the |
you are probably rigth, in that there is missing understanding of these blocks, groups and member-group things and a lot of copy and paste. |
I know I am guilty of it. |
I believe /**
* @ingroup foo
* @{
*/
/** @} */ creates a member group (between the braces) and places that member group into the topic group foo. Where-as: /**
* @addtogroup foo
* @{
*/
/** @} */ adds everything between the braces to the group foo. |
all of them can have blockes open |
no this puts things in a group that must be existing (created by either: defgroup or addgroup or weakgroup)
either add to an existing group or creates a new one |
I agree with everything above, except the statement that
|
hmm. I may be wrong
(https://www.doxygen.nl/manual/grouping.html) But still something is up. You can see it int the example I provide for the steps to reproduce. |
at least we wouldn't be alone with that |
in the
in the spi file are some |
doxygen also reads some blocking/grouping from the comments and some from the source code |
I too was suspicious of the |
Ok, so I tried removing all the inner member groups, still none of the comment blocks showed up in the parent topic. Next, I replaced Next, I put all the inner member groups back, leaving the Finally, I restored the file back to its original state and added a diff --git a/cpu/stm32/include/periph/cpu_spi.h b/cpu/stm32/include/periph/cpu_spi.h
index 3fa42e11d4..26a49975a4 100644
--- a/cpu/stm32/include/periph/cpu_spi.h
+++ b/cpu/stm32/include/periph/cpu_spi.h
@@ -8,6 +8,7 @@
*/
/**
+ * @defgroup cpu_stm32_periph_spi SPI
* @ingroup cpu_stm32
* @{
*
And now the parent topic (CPU/STM32) contains the new SPI topic with everything in the file showing under the new topic group. Conclusion, |
I now re-read the previous quote:
and see that the use of braces is referred to "put in the documentation of the group definition" ( |
I think to understand the choice of command words and their why you would need to dig through the history of doxygen and maybe javadoc. Thanks for investigating |
I have updated this issue's title and description to describe the real problem that is occurring. A very simple approach to fixing this is replacing The other approach is to add a A third approach, and I believe is the best, is remove these braces when |
thank you for diving
addtogroup would need a group title i think -not sure it seems to be optional- and the first addtogroup with title would define the group title I would like to make @miri64 (does a lot of documentation things) and @maribu (most recent edits in the /doc folder) aware of this issue. @Enoch247 may be a/some PR(s) would having one or some file(s) changed in the suggested ways would help to illustrate (please link this issue) I think there also was some thought in the air of having another renderer (MkDocs or Sphinx ) for the documentation output. We certainly will want to avoid compatibility issues |
Regarding the use of Sphinx: We would use breathe, which parses the XML output of Doxygen, to generate the API doc. Thus, switching to breathe would only fix the "website looks ugly" issue. Any issues with Doxygen would stay by thay switch. |
Time permitting (I am very deep into working on the STM32H7 port at the moment, which has lead down some other tangential paths) I can do a example PR as suggested.
Not in this case. In the cases I describe, it is only to replace |
Description
This issue was first noticed here: #20531 (comment)
The Issue
The real problem
Many of the cpu/stm32 specific headers (and probably other CPUs and board specific headers as well) use the following pattern:
This was probably motivated by the very similar pattern used in (for example) many device driver header files with a very small difference:
The difference is the presence of the
defgroup
in the second example. With thedefgroup
, all the code between the braces is being added to the new group and the new group is added to the parent. This is because the braces are part of the syntax of thedefgroup
cmd.ingroup
syntax does not support use of braces. So when the open brace is encounter by doxygen, it creates what is called a member group, which is not the same as topic groups created by thedefgroup
command.ingroup
cannot be applied to member groups. Theingroup
is applied to anything in the same comment block that the cmd is located in. In practice this means that theingroup
is applied to thefile
cmd within the comment block, but nothing else within the file, as the braces would tend to mislead one to belive. Furthermore, member groups cannot be nested. So files making use of member groups, wind up with nested member groups, because their member groups are nested inside of the accidentally created file-wide member group.Originally perceived problem
The following is kept as mater of record. It describes what I thought was the root cause. Further testing showed the reall issue as described above.
The previous paragraphs are kept as mater of record. See real issue above
Steps to reproduce the issue
Go to the doc page for the topic CPU/STM32 (retrieved April 3, 2024) and see that only files and other topics ("Modules") are linked at the bottom. Notice in the STM32 specific SPI header, the file is wrapped (lines 12 - 139) with a group preceded by the
@ingroup cpu_stm32
cmd. Also notice that there are several other groups nested in the file's outer most.Expected results
All the enums, macros, typedefs, etc should be listed in the STM32's main topic page if the outer most group was being honored.
Actual results
Anything after the first opening cmd of a nested member group is not actual added to the outer most group's topic.
Versions
The text was updated successfully, but these errors were encountered: