Problem/Motivation

  • Our documentation standards for defgroups recommend the following closure for a defgroup:
    /**
     * @} End of "defgroup group_identifier".
     */
    

    This causes the "End of foo" text to be printed on the group page in both api.d.o output and documentation generated with vanilla doxygen. See, for example, the actions group page.

Proposed resolution

  • TBD

Remaining tasks

  1. Find a way of indicating what the @} closes that won't get printed in the generated docs.
  2. Test the proposed change with the API module.
  3. Consensus on whether to make this change.
  4. Update the documentation standards for defgroups.
  5. Patch malformed group closures in core.

User interface changes

  • None.

API changes

  • None.
CommentFileSizeAuthor
#6 ingroup-D7.patch743 bytestr
#4 ingroup.patch783 bytestr

Comments

xjm’s picture

Issue summary: View changes

(xjm) Updated summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

Hmm, actually, my first proposed resolution doesn't actually work, at least with vanilla doxygen. Updating the summary...

xjm’s picture

Issue summary: View changes

Updated issue summary.

xjm’s picture

This seems to work with vanilla doxygen, at least:

/**
 * End of "foo".
 * @}
 */
xjm’s picture

Issue summary: View changes

Updated issue summary.

jhodgdon’s picture

Have you tested this proposed fix with the API module yet? And just curious, what was your first suggestion that didn't work?

Maybe we should just fix this in the API module anyway rather than changing the standard?

tr’s picture

StatusFileSize
new783 bytes

(This issue is similar to #1358944: Misused @ingroup commands, although that other issue doesn't address core/includes/actions.inc)

What I see is that actions.inc is not following the rules - I don't think the rules need to be changed.

When a doc block is just defining a group, then the example given in our documentation standards for defgroups says to do this:

Here is the basic syntax for defining a group:

/**
 * @defgroup group_identifier Name of the group for Topics page
 * @{
 * One line, one sentence description of the topic/group.
 *
 * One or more additional paragraphs of information, which will appear
 * on the topic page.
 * @}
 */

Note there is no recommendation to add "End of" after the @}, because when @{ and @} are in the same block "End of" is unneeded.

What actions.inc does is to add additional text after that @}. Any text in the doc block that's not part of a doxygen tag will properly show up in the API docs. There is no reason to add 'End of "defgroup actions"' here!

An alternative way of defining groups is also spelled out in our documentation standards for defgroups:

If you put the group definition immediately before one or more functions that belong in the group, you can automatically add functions to the group by using this syntax:

/**
 * @defgroup group_identifier Name of the group for Topics page
 * @{
 * One line, one sentence description of the topic/group.
 *
 * One or more additional paragraphs of information, which will appear
 * on the topic page.
 */

// Functions here are automatically added to the group.

/**
 * @} End of "defgroup group_identifier".
 */

Note that here the "End of" comment *is* needed, because there's a large gap between the doc block containing the @{ and the SEPARATE doc block whose sole purpose is to hold the @} tag. The block with the end tag is not commenting any function, so any text in this block never shows up in the API docs.

action.inc is mixing the two styles. It needs to choose one or the other. core/includes/form.inc makes the same mistake - all the other core/includes/*.inc files do the right thing. Attached is a patch to fix both actions.inc and form.inc. But perhaps this fix should be part of #1358944: Misused @ingroup commands ?

jhodgdon’s picture

Status: Active » Reviewed & tested by the community

This fix looks fine, and should fix the issue. Glad the standards are fine as they are. :)

tr’s picture

Issue tags: +Needs backport to D7
StatusFileSize
new743 bytes

Here's the same patch for D7.

xjm’s picture

Yay. :)

jhodgdon’s picture

Title: @defgroup closure standard prints "End of foo group" on API and doxygen output » "End of foo group" on a couple of API pages due to not following standards

Fixing issue title to reflect what the problem actually is.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x. I believe this was already committed to 8.x. Marking as 'fixed'. Thanks for continuously making our documentation better!

jhodgdon’s picture

Thanks! It does indeed look like it is fixed in 8.x also.

xjm’s picture

sun’s picture

I'm not sure whether sufficient research went into this issue.

As far as I can look back in my PHP dev, I've always seen and used this syntax (also prior to Drupal).

sun’s picture

oh, I'm mistaken. You only removed it from blocks that opened a section in the very same block.

That's fine.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.