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

Apply field-list and admonition handling to classes and unions #764

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Inspired by `Keepachangelog.com <http://keepachangelog.com/>`__.
`#749 <https://github.com/michaeljones/breathe/pull/749>`__
- Make ``.. doxygenfunction`` handle function template specializations.
`#750 <https://github.com/michaeljones/breathe/pull/750>`__
- Properly handle field-lists and admonitions in the detailed description of
classes and functions.
`#764 <https://github.com/michaeljones/breathe/pull/764>`__

- 2021-09-14 - **Breathe v4.31.0**

Expand Down
10 changes: 7 additions & 3 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@ def title(self, node) -> List[Node]:

def description(self, node) -> List[Node]:
brief = self.render_optional(node.briefdescription)
detailed = self.detaileddescription(node)
return brief + detailed

def detaileddescription(self, node) -> List[Node]:
detailedCand = self.render_optional(node.detaileddescription)
# all field_lists must be at the top-level of the desc_content, so pull them up
fieldLists = [] # type: List[nodes.field_list]
Expand Down Expand Up @@ -934,9 +938,9 @@ def pullup(node, typ, dest):
fieldLists = [fl]

if self.app.config.breathe_order_parameters_first: # type: ignore
return brief + detailed + fieldLists + admonitions
return detailed + fieldLists + admonitions
else:
return brief + detailed + admonitions + fieldLists
return detailed + admonitions + fieldLists

def update_signature(self, signature, obj_type):
"""Update the signature node if necessary, e.g. add qualifiers."""
Expand Down Expand Up @@ -1300,7 +1304,7 @@ def addnode(kind, lam):

if "members-only" not in options:
addnode("briefdescription", lambda: self.render_optional(node.briefdescription))
addnode("detaileddescription", lambda: self.render_optional(node.detaileddescription))
addnode("detaileddescription", lambda: self.detaileddescription(node))

def render_derivedcompoundref(node):
if node is None:
Expand Down