X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=make-directive-index.py;h=48d830e96f01ea7123b33cb8896c98ded909962f;hp=51d28c4fae71c5f1c6209a927d6c7e430de460c4;hb=9bdbc2e2ec523dbefe1c1c7e164b5544aff0b185;hpb=eeb019b5b5db785feb0666f3238b1240e7f3e42e diff --git a/make-directive-index.py b/make-directive-index.py index 51d28c4fa..48d830e96 100755 --- a/make-directive-index.py +++ b/make-directive-index.py @@ -40,7 +40,7 @@ TEMPLATE = '''\ systemd.directives - 5 + 7 @@ -66,6 +66,23 @@ TEMPLATE = '''\ + + Options on the kernel command line + + Kernel boot options for configuring the behaviour of the + systemd process. + + + + + + Environment variables + + Environment variables understood by the systemd process. + + + + UDEV directives @@ -92,9 +109,19 @@ TEMPLATE = '''\ + + + Colophon + + ''' +COLOPHON = '''\ +This index contains {count} entries in {sections} sections, +referring to {pages} individual manual pages. +''' + def _extract_directives(directive_groups, page): t = tree.parse(page) section = t.find('./refmeta/manvolnum').text @@ -125,6 +152,19 @@ def _make_section(template, name, directives): d.text = manvolume entry.tail = '\n\n' +def _make_colophon(template, groups): + count = 0 + pages = set() + for group in groups: + count += len(group) + for pagelist in group.values(): + pages |= set(pagelist) + + para = template.find(".//para[@id='colophon']") + para.text = COLOPHON.format(count=count, + sections=len(groups), + pages=len(pages)) + def _make_page(template, directive_groups): """Create an XML tree from directive_groups. @@ -137,6 +177,8 @@ def _make_page(template, directive_groups): for name, directives in directive_groups.items(): _make_section(template, name, directives) + _make_colophon(template, directive_groups.values()) + return template def make_page(xml_files):