make-directive-index: allow variablelist to specify an element to index

This commit looks for a new "extra-ref" attribute in <variablelist>
If this attribute is specified, its content will be index as pointing to
the current man-page in systemd.directives
This commit is contained in:
Jérémy Rosen 2020-04-18 19:48:13 +02:00
parent acbfdec33e
commit 8906e26278
1 changed files with 7 additions and 0 deletions

View File

@ -200,6 +200,13 @@ def _extract_directives(directive_groups, formatting, page):
name.tail = ''
name.text = text
formatting[text] = name
extra = variablelist.attrib.get('extra-ref')
if extra:
stor[extra].append((pagename, section))
if extra not in formatting:
elt = tree.Element("varname")
elt.text= extra
formatting[extra] = elt
storfile = directive_groups['filenames']
for xpath, absolute_only in (('.//refsynopsisdiv//filename', False),