Skip to content

Commit

Permalink
renderer: use retval type for the retval fields
Browse files Browse the repository at this point in the history
This change makes @RetVal fields to render as a separate list,
independent of the @return/s entries.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
  • Loading branch information
gmarull committed Oct 4, 2021
1 parent 327374d commit b51ad6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions breathe/renderer/sphinxrenderer.py
Expand Up @@ -896,7 +896,7 @@ def pullup(node, typ, dest):
fieldLists = [fieldList]

# collapse retvals into a single return field
if len(fieldLists) != 0:
if len(fieldLists) != 0 and sphinx.version_info[0:2] < (4, 3):
others: nodes.field = []
retvals: nodes.field = []
for f in fieldLists[0]:
Expand Down Expand Up @@ -2211,7 +2211,8 @@ def visit_docparamlist(self, node) -> List[Node]:
"param": "param",
"exception": "throws",
"templateparam": "tparam",
"retval": "returns",
# retval support available on Sphinx >= 4.3
"retval": "returns" if sphinx.version_info[0:2] < (4, 3) else "retval",
}

# https://docutils.sourceforge.io/docs/ref/doctree.html#field-list
Expand Down

0 comments on commit b51ad6f

Please sign in to comment.