mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
make-directive-index: allow pages to specify the path to search
So far, make-directive-index would look for ./valistentry/term/varname for elements to add to the directive man page. This commit allows to specify xpath= in the varlist directive to tell the generator what to look for.
This commit is contained in:
parent
d512670a1f
commit
acbfdec33e
@ -180,9 +180,10 @@ def _extract_directives(directive_groups, formatting, page):
|
||||
storopt = directive_groups['options']
|
||||
for variablelist in t.iterfind('.//variablelist'):
|
||||
klass = variablelist.attrib.get('class')
|
||||
searchpath = variablelist.attrib.get('xpath','./varlistentry/term/varname')
|
||||
storvar = directive_groups[klass or 'miscellaneous']
|
||||
# <option>s go in OPTIONS, unless class is specified
|
||||
for xpath, stor in (('./varlistentry/term/varname', storvar),
|
||||
for xpath, stor in ((searchpath, storvar),
|
||||
('./varlistentry/term/option',
|
||||
storvar if klass else storopt)):
|
||||
for name in variablelist.iterfind(xpath):
|
||||
|
Loading…
Reference in New Issue
Block a user