make-directive-index.py revision e1abd3efabb95a30d0702ed1c7c33c57bf898297
# -*- coding: utf-8 -*-
import sys
import collections
TEMPLATE = '''\
<refentry id="systemd.directives">
<refentryinfo>
<title>systemd.directives</title>
<productname>systemd</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Zbigniew</firstname>
<surname>Jędrzejewski-Szmek</surname>
<email>zbyszek@in.waw.pl</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>systemd.directives</refentrytitle>
<manvolnum>5</manvolnum>
</refmeta>
<refnamediv>
<refname>systemd.directives</refname>
<refpurpose>Index of configuration directives</refpurpose>
</refnamediv>
<refsect1>
<title>Unit directives</title>
<para>Directives for configuring units, used in unit
files.</para>
<variablelist id='unit-directives' />
</refsect1>
<refsect1>
<title>UDEV directives</title>
<para>Directives for configuring systemd units through the
udev database.</para>
<variablelist id='udev-directives' />
</refsect1>
</refentry>
'''
b = None
if b is not None:
b.tail = ', '
def _make_page(directive_groups):
"""Create an XML tree from directive_groups.
directive_groups = {
'class': {'variable': [('manpage', 'manvolume'), ...],
'variable2': ...},
...
}
"""
return refentry
"Extract directives from xml_files and return XML index tree."
for name in ['unit-directives',
'udev-directives',
]}
return _make_page(directive_groups)
if __name__ == '__main__':