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

Collapse multiple retvals into a single bullet list #697

Merged
merged 1 commit into from
May 18, 2021

Conversation

jakobandersen
Copy link
Collaborator

After the change to use Docutils/Sphinx field lists the rendering of \retval was a bit icky as there is no direct equivalent.
This changes the rendering of them to gather them into a single field. If there are multiple \retvals they will be made into a bullet list in the same field body.
E.g., for

/*! Something myFunction short.
 *
 * Something myFunction long.
 *
 * @param p pdesc
 * @param fp fpdesc
 * @return ReturnDesc
 * @retval "Discovery status" The discovery status
 * @retval MAX_EVENTS         The pointer
 */
void myFunction(int *p, void (*fp)()) {

it now gets compiled into
breathe_retval
Note, only the \revals are touched, as they are the ones that mentions a value, but \returnss are left as individual fields as map directly to the field in Sphinx (is it common to have both \retvals and \retuns at the same time?)

See also #684 and #687.
Fixes part of #695.

@vermeeren vermeeren self-requested a review May 18, 2021 23:24
@vermeeren vermeeren self-assigned this May 18, 2021
@vermeeren vermeeren added the code Source code label May 18, 2021
@vermeeren
Copy link
Collaborator

(is it common to have both \retvals and \retuns at the same time?)

@jakobandersen Specifically about this, I haven't seen this in the wild myself, so should be fine as-is. Could be I have experience with the wrong projects though.

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.

Thanks!

michaeljones pushed a commit that referenced this pull request May 18, 2021
@michaeljones michaeljones merged commit e08017a into breathe-doc:master May 18, 2021
@jakobandersen jakobandersen deleted the return_fields branch May 19, 2021 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants