Skip to content

Commit acbfdec

Browse files
committed
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.
1 parent d512670 commit acbfdec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/make-directive-index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,10 @@ def _extract_directives(directive_groups, formatting, page):
180180
storopt = directive_groups['options']
181181
for variablelist in t.iterfind('.//variablelist'):
182182
klass = variablelist.attrib.get('class')
183+
searchpath = variablelist.attrib.get('xpath','./varlistentry/term/varname')
183184
storvar = directive_groups[klass or 'miscellaneous']
184185
# <option>s go in OPTIONS, unless class is specified
185-
for xpath, stor in (('./varlistentry/term/varname', storvar),
186+
for xpath, stor in ((searchpath, storvar),
186187
('./varlistentry/term/option',
187188
storvar if klass else storopt)):
188189
for name in variablelist.iterfind(xpath):

0 commit comments

Comments
 (0)