Skip to content
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

Add support for innergroup #556

Merged
merged 3 commits into from
Aug 19, 2020

Conversation

utzig
Copy link
Contributor

@utzig utzig commented Jul 8, 2020

Doxygen groups that are defined inside another group, either by scope or by using \ingroup, are not automatically added to the documentation unless an explicit reference is created. This commit adds parsing of innergroup elements inside compound defs.

Fixes #555

@utzig utzig changed the title [RFC] WIP - Add support for innergroup [RFC][WIP] Add support for innergroup Jul 9, 2020
@utzig utzig changed the title [RFC][WIP] Add support for innergroup [RFC] Add support for innergroup Jul 10, 2020
@utzig
Copy link
Contributor Author

utzig commented Jul 14, 2020

I'm not sure if I am missing something for a review to happen, but would be glad to get some feedback!

@vermeeren
Copy link
Collaborator

I will try to review as soon as I can, a bit busy right now as a side effect of having been sick for a while. The same applies to other issues and PRs in the past week and a half or so. Sorry for the delay.

@svenevs
Copy link

svenevs commented Jul 14, 2020

As a first pass it looks good to me, nice work / good addition! We need a test / example case for this, can you please add a simple innergroup example / make sure to include it in the sphinx docs? https://github.com/michaeljones/breathe/tree/master/examples

That will help us confirm it works as desired, and also show users how to use it. I would like to help review this further for @vermeeren (feel better soon! ❤️) but I don't really have any experience with doxygen groups... The example will help me confirm it works correctly 🙂

@@ -1024,6 +1024,12 @@ def render_derivedcompoundref(node):
addnode('innerclass', lambda: self.render_iterable(node.innerclass))
addnode('innernamespace', lambda: self.render_iterable(node.innernamespace))

if 'inner' in options:
for node in node.innergroup:
Copy link

Choose a reason for hiding this comment

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

In the event that inner is requested but there are no inner groups, should we emit a warning along the lines of inner groups requested for group {group name} but no inner groups found!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, and there's also the other way around. If there are innergroups but no inner keyword was given in the options. To preserve compatibility this should obviously not trigger a warning. I am honestly not sure if someone would like the behavior of generating a warning in the case you pointed, but I will assume so and update accordingly. It can always be removed later! Btw, adding an inner in the documentation set I am working on, already triggers lots and lots of warnings because of the double references, because we basically had to create a reference to each group individually due to the lack of innergroup parsing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thinking a bit better about this, turns out that options is part of a "global" context in a sense. So if I have an innergroup B inside another group A, and I set inner, both A and B will be checked for the existence of innergroups. This will end up being an empty list for the innergroup B (assuming it has no innergroups itself!); but it should not trigger a warning.

@utzig
Copy link
Contributor Author

utzig commented Jul 20, 2020

As a first pass it looks good to me, nice work / good addition! We need a test / example case for this, can you please add a simple innergroup example / make sure to include it in the sphinx docs?

Thanks Stephen, I added a test: a127be6. An example already exists that creates an innergroup: https://github.com/michaeljones/breathe/blob/master/examples/doxygen/group.cpp#L26. It just so happens that it is currently ignored! I am not exactly sure what you mean by "sphinx docs", is adding this 3e36e59#diff-fb6911bd4f08815018ea2c65e04aa85cR45 not enough?

Doxygen groups that are defined inside another group, either by scope or
by using \ingroup, are not automatically added to the documentation
unless an explicit reference is created.

This commit adds parsing of innergroup elements inside compound defs.

When using a group directive, .. doxygengroup:: myGroup, a new option
":inner:" must be added to include all innergroup elements. This allows
maintaining compatibility with previous projects.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
Add :inner: usage example and update group.h header to include a new
group inside mygroup.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
Add a new test to check that an innergroup is parsed when the "inner"
keyword is given in the options.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
@utzig
Copy link
Contributor Author

utzig commented Jul 22, 2020

As a first pass it looks good to me, nice work / good addition! We need a test / example case for this, can you please add a simple innergroup example / make sure to include it in the sphinx docs?

Thanks Stephen, I added a test: a127be6. An example already exists that creates an innergroup: https://github.com/michaeljones/breathe/blob/master/examples/doxygen/group.cpp#L26. It just so happens that it is currently ignored! I am not exactly sure what you mean by "sphinx docs", is adding this 3e36e59#diff-fb6911bd4f08815018ea2c65e04aa85cR45 not enough?

I added an example with :inner: usage now, it was not clear to me what you meant before!

@utzig utzig changed the title [RFC] Add support for innergroup Add support for innergroup Jul 30, 2020
@utzig
Copy link
Contributor Author

utzig commented Aug 8, 2020

@vermeeren Could you take a look?

@vermeeren vermeeren self-assigned this Aug 19, 2020
@vermeeren vermeeren self-requested a review August 19, 2020 20:43
@vermeeren vermeeren added the enhancement Improvements, additions (also cosmetics) label Aug 19, 2020
Copy link
Collaborator

@vermeeren vermeeren left a comment

Choose a reason for hiding this comment

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

Everything looks good to me @utzig , thanks for the patches!

@vermeeren vermeeren merged commit 762ee42 into breathe-doc:master Aug 19, 2020
vermeeren added a commit that referenced this pull request Aug 19, 2020
@utzig utzig deleted the add-innergroup-support branch August 19, 2020 22:14
@utzig
Copy link
Contributor Author

utzig commented Aug 20, 2020

@vermeeren The official documentation does not yet reflect the changes, is it published automatically?

@vermeeren
Copy link
Collaborator

@utzig There is a problem with the RTD docs being out of sync since quite a while, see #475. I will try asking Michael again and hopefully get a reply, I don't have permission on RTD I think.

If this isn't resolved soon I think I will self-host the breathe docs, because it is indeed quite a big problem.

utzig added a commit to utzig/breathe that referenced this pull request Aug 28, 2020
Leftover from PR breathe-doc#556; updated directives.rst to include :inner:

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements, additions (also cosmetics)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doxygen inner groups are not supported
3 participants