@@ -86,7 +86,13 @@ def render_list(l, markdown_help, settings=None):
86
86
return all_children
87
87
88
88
89
- def print_action_groups (data , nested_content , markdown_help = False , settings = None ):
89
+ def print_action_groups (
90
+ data ,
91
+ nested_content ,
92
+ markdown_help = False ,
93
+ settings = None ,
94
+ id_prefix = '' ,
95
+ ):
90
96
"""
91
97
Process all 'action groups', which are also include 'Options' and 'Required
92
98
arguments'. A list of nodes is returned.
@@ -97,7 +103,8 @@ def print_action_groups(data, nested_content, markdown_help=False, settings=None
97
103
for action_group in data ['action_groups' ]:
98
104
# Every action group is composed of a section, holding
99
105
# a title, the description, and the option group (members)
100
- section = nodes .section (ids = [action_group ['title' ].replace (' ' , '-' ).lower ()])
106
+ title_as_id = action_group ['title' ].replace (' ' , '-' ).lower ()
107
+ section = nodes .section (ids = [f'{ id_prefix } -{ title_as_id } ' ])
101
108
section += nodes .title (action_group ['title' ], action_group ['title' ])
102
109
103
110
desc = []
@@ -487,6 +494,7 @@ def run(self):
487
494
f = self ._open_filename ()
488
495
code = compile (f .read (), self .options ['filename' ], 'exec' )
489
496
exec (code , mod )
497
+ module_name = None
490
498
attr_name = self .options ['func' ]
491
499
func = mod [attr_name ]
492
500
else :
@@ -563,6 +571,7 @@ def run(self):
563
571
nested_content ,
564
572
markdown_help ,
565
573
settings = self .state .document .settings ,
574
+ id_prefix = (f'{ module_name } -' if module_name else '' ) + attr_name ,
566
575
)
567
576
)
568
577
if 'nosubcommands' not in self .options :
0 commit comments