Skip to content

Commit

Permalink
transmute: support sphinx-toolbox collapse node label change
Browse files Browse the repository at this point in the history
An update [1] has been made to sphinx-toolbox's CollapseNode. Adjusting
the transmute logic to support the variant label approaches.

[1]: sphinx-toolbox/sphinx-toolbox@ae0ae83

Signed-off-by: James Knight <james.d.knight@live.com>
  • Loading branch information
jdknight committed Aug 17, 2024
1 parent 13ea707 commit 355d2bb
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ def replace_sphinx_toolbox_nodes(builder, doctree):
for node in findall(doctree, sphinx_toolbox_CollapseNode):
new_node = confluence_expand(node.rawsource,
*node.children, **node.attributes)
new_node.attributes['title'] = node.label

if hasattr(node, 'label'):
new_label = node.label
else:
new_label = node.get('label', '')

new_node.attributes['title'] = new_label
node.replace_self(new_node)

if has_sphinx_toolbox_github_issues:
Expand Down

0 comments on commit 355d2bb

Please sign in to comment.