Skip to content

add *.doc.md to doxygen sources #21319

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

Merged
merged 2 commits into from
Apr 1, 2025
Merged

Conversation

kfessel
Copy link
Contributor

@kfessel kfessel commented Mar 25, 2025

adds *.doc.md files to doc source for doxygen documentation and provide mutex.doc.md as an example.

Testing procedure

  • read
  • run the doccheck
  • see static test
  • check the CI generated Documentation.

Issues/PRs references

#21288

@github-actions github-actions bot added Area: doc Area: Documentation Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: tools Area: Supplementary tools labels Mar 25, 2025
@kfessel kfessel added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Mar 25, 2025
@riot-ci
Copy link

riot-ci commented Mar 25, 2025

Murdock results

✔️ PASSED

1446aea core/mutex: separate documentation

Success Failures Total Runtime
1 0 1 01m:35s

Artifacts

@mguetschow
Copy link
Contributor

This changes the place where the mutex functions are documented: On master they are directly on the Mutex page, while this PR only lists the mutex.h file there, which in turn contains the functions.

@kfessel
Copy link
Contributor Author

kfessel commented Mar 25, 2025

This changes the place where the mutex functions are documented: On master they are directly on the Mutex page, while this PR only lists the mutex.h file there, which in turn contains the functions.

strange


sorry for the noise i tested different variants to tell doxygen that these function are in the group (@ingroup) but it seems to think it needs a subgroup for that file

@mguetschow
Copy link
Contributor

Maybe @carl-tud can enlighten us? 😇

Comment on lines 11 to 12
* @{
*
* @ingroup core_sync_mutex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @{
*
* @ingroup core_sync_mutex
* @addtogroup core_sync_mutex
* @{

The reason for the behavior observed by @mguetschow lies in the priority of the grouping commands: https://www.doxygen.nl/manual/grouping.html

The priorities of grouping definitions are (from highest to lowest): \ingroup, \defgroup, \addtogroup, \weakgroup.

The @ingroup command has a higher priority than @defgroup, which means that the contents of the header are not added to the group defined by @defgroup in the mutex.doc.md file. However the contents of the Markdown file can't be added to the header either, therefore Doxygen only creates the separate documentation page for the header.

The opening brackets should be below the command as well, but that is not the cause of the issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@kfessel kfessel Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not show a different behavior

defgroup ^= create a new group and put stuff inside
ingroup ^= put stuff in group

defgroup, ingroup ^= create a new group put it inside another group and put stuff into the new (sub)group

addtogroup ^= defgroup but do not care if already existing (basically fallback to ingroup) (defgroup with same label has priority for title and placement of that group)
weakgroup ^= addtogroup but this title has even less priority for the label and placement

The priotity is just within one doc-comment

search for ingroup -> place there; search for defgroup -> create new group and place there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not show a different behavior

It's not entirely unlikely that there's a bug in Doxygen in that regard...

The priotity is just within one doc-comment

..but I didn't find any reference in the Doxygen grouping documentation that this is the case. Or I missed it.

Copy link
Contributor Author

@kfessel kfessel Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To define a group, you should put the \defgroup command in a special comment block. ...

defgroup ^= create a new group and put stuff inside

You can make an entity a member of a specific group by putting a \ingroup command inside its documentation block.

ingroup ^= put stuff in group

To avoid putting \ingroup commands in the documentation for each member you can also group members together by the open marker @{ before the group and the closing marker @} after the group. The markers can be put in the documentation of the group definition or in a separate documentation block.

doxygen should have applied the ingroup label to everything in that @{ group but it somehow created a subgroup

If you don't want Doxygen to enforce unique labels, then you can use \addtogroup instead of \defgroup. It can be used exactly like \defgroup, but when the group has been defined already, then it silently merges the existing documentation with the new one.

addtogroup is defgroup with ingroup fallback

since non of this steps does nothing about priorities the priorities thing must be something else which is the evaluation order with in one step of placing a thing in the the documentation it goes ingroup then defgroup then add/weakgroup

so it does not care whether one writes :

@ingroup in
@defgroup def
@addgroup add

or

@defgroup def
@addgroup add
@ingroup in

both will result in in>def>add in the group tree and the documented thing being placed there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe there is something in the documentation that says "files implicitly define their own (sub)group unless there is an explicit defgroup (or addtogroup) " and addtogroup being defgroup

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid putting \ingroup commands in the documentation for each member you can also group members together by the open marker @{ before the group and the closing marker @} after the group. The markers can be put in the documentation of the group definition or in a separate documentation block.

doxygen should have applied the ingroup label to everything in that @{ group but it somehow created a subgroup

I think @{ ... @} just starts a new group (without giving it a name) which is then put inside another group with @ingroup. So that's consistent with what we saw.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can see this not happening in the sys_event documentation (all the different headers are added to the same group using an ingroup statement) and there is also no subgroup with addtogroup

and the thing i cited is from the doxygen documentation

To avoid putting \ingroup commands in the documentation -- as in thevfollowing will have the same effect-- for each member you can also group members together by the open marker @{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can see this not happening in the sys_event documentation (all the different headers are added to the same group using an ingroup statement) and there is also no subgroup with addtogroup

Ah now I see what you mean, different semantics if @defgroup is followed by @{ vs. some @ingroup is followed by @{ (as in if you split the @defgroup out to a doc.md). But I guess in that case you actually need @addtogroup then. As in @defgroup implies @addtogroup, but @ingroup doesn't.

All the other header files listed on the Event Queue API page have none of their symbols listed on that same page directly, but only on the header file pages, e.g., https://doc.riot-os.org/callback_8h.html. Those implicit header file groups have no name (I would expect this example to be sys_event_callback for example).

@crasbe crasbe linked an issue Mar 26, 2025 that may be closed by this pull request
@kfessel
Copy link
Contributor Author

kfessel commented Mar 27, 2025

I think it might be even better to place the api with the file and separate the apis but keep them close from to the system descrition

see https://doc.riot-os.org/group__sys__event.html for a real mess of apis mashed together in one big page

@mguetschow
Copy link
Contributor

I think it might be even better to place the api with the file and separate the apis but keep them close from to the system descrition

see https://doc.riot-os.org/group__sys__event.html for a real mess of apis mashed together in one big page

I disagree. High-level description of a module and its API are closely related, so I'd rather have them together without needing to search for them / requiring an extra mouse click.

@crasbe
Copy link
Contributor

crasbe commented Mar 28, 2025

You can squash the commits as well.

@kfessel kfessel marked this pull request as ready for review March 28, 2025 11:02
@crasbe
Copy link
Contributor

crasbe commented Mar 28, 2025

From my side, this looks good. What do you say @mguetschow?

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mguetschow mguetschow added this pull request to the merge queue Apr 1, 2025
Merged via the queue into RIOT-OS:master with commit a3a53fb Apr 1, 2025
26 checks passed
@mguetschow mguetschow added this to the Release 2025.04 milestone Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: doc Area: Documentation Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc: *.doc.md in addition to doc.md
4 participants