make-directive-index.py revision 08177c85efd52c2c2ab00991791649ad8cf61297
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2012 Zbigniew Jędrzejewski-Szmek
#
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
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>System manager directives</title>
<para>Directives for configuring the behaviour of the
systemd process.</para>
<variablelist id='systemd-directives' />
</refsect1>
<refsect1>
<title>Options on the kernel command line</title>
<para>Kernel boot options for configuring the behaviour of the
systemd process.</para>
<variablelist id='kernel-commandline-directives' />
</refsect1>
<refsect1>
<title>Environment variables</title>
<para>Environment variables understood by the systemd process.</para>
<variablelist id='environment-variables' />
</refsect1>
<refsect1>
<title>UDEV directives</title>
<para>Directives for configuring systemd units through the
udev database.</para>
<variablelist id='udev-directives' />
</refsect1>
<refsect1>
<title>Journal directives</title>
<para>Directives for configuring the behaviour of the
journald process.</para>
<variablelist id='journal-directives' />
</refsect1>
<refsect1>
<title>bootchart.conf directives</title>
<para>Directives for configuring the behaviour of the
systemd-bootchart process.</para>
<variablelist id='bootchart-directives' />
</refsect1>
<refsect1>
<title>Colophon</title>
<para id='colophon' />
</refsect1>
</refentry>
'''
COLOPHON = '''\
This index contains {count} entries in {sections} sections,
referring to {pages} individual manual pages.
'''
b = None
if b is not None:
b.tail = ', '
count = 0
"""Create an XML tree from directive_groups.
directive_groups = {
'class': {'variable': [('manpage', 'manvolume'), ...],
'variable2': ...},
...
}
"""
return template
"Extract directives from xml_files and return XML index tree."
if __name__ == '__main__':