chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemd-python: wrap sd_login_monitor
[elogind.git]
/
make-directive-index.py
diff --git
a/make-directive-index.py
b/make-directive-index.py
index 99e7bfaf2856e1500796d7af913ff615d63292e3..396947b3030f6c271fcec46d55e911abfbbc3a8a 100755
(executable)
--- a/
make-directive-index.py
+++ b/
make-directive-index.py
@@
-193,16
+193,25
@@
def _extract_directives(directive_groups, formatting, page):
formatting[text] = name
storfile = directive_groups['filenames']
formatting[text] = name
storfile = directive_groups['filenames']
- for xpath in ('.//refsynopsisdiv//filename',
- './/refsynopsisdiv//command'):
+ for xpath, absolute_only in (('.//refsynopsisdiv//filename', False),
+ ('.//refsynopsisdiv//command', False),
+ ('.//filename', True)):
for name in t.iterfind(xpath):
for name in t.iterfind(xpath):
+ if absolute_only and not (name.text and name.text.startswith('/')):
+ continue
+ if name.attrib.get('noindex'):
+ continue
name.tail = ''
if name.text:
name.tail = ''
if name.text:
+ if name.text.endswith('*'):
+ name.text = name.text[:-1]
if not name.text.startswith('.'):
text = name.text.partition(' ')[0]
if text != name.text:
name.clear()
name.text = text
if not name.text.startswith('.'):
text = name.text.partition(' ')[0]
if text != name.text:
name.clear()
name.text = text
+ if text.endswith('/'):
+ text = text[:-1]
storfile[text].append((pagename, section))
if text not in formatting:
# use element as formatted display
storfile[text].append((pagename, section))
if text not in formatting:
# use element as formatted display