Skip to content

Commit

Permalink
Insert signature name into node attribute for use as short headings
Browse files Browse the repository at this point in the history
If it's a function, add parentheses to the name.
  • Loading branch information
scottamain committed Oct 30, 2023
1 parent 42d731b commit 1485dd0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,14 @@ def content(contentnode):
assert len(desc) >= 1
sig = desc[0]
assert isinstance(sig, addnodes.desc_signature)

# Insert the member name for use in Sphinx-generated table of contents.
member_name = node.get_name()
if obj_type == "function":
member_name += "()"
sig.attributes["_toc_name"] = member_name
sig.attributes["_toc_parts"] = member_name

# if may or may not be a multiline signature
isMultiline = sig.get("is_multiline", False)
declarator: Optional[Declarator] = None
Expand Down

0 comments on commit 1485dd0

Please sign in to comment.