diff --git a/man/directives-template.xml b/man/directives-template.xml
new file mode 100644
index 0000000000..3583db3ef0
--- /dev/null
+++ b/man/directives-template.xml
@@ -0,0 +1,182 @@
+
+
+
+
+ systemd.directives
+ systemd
+
+
+
+ systemd.directives
+ 7
+
+
+
+ systemd.directives
+ Index of configuration directives
+
+
+
+ Unit directives
+
+ Directives for configuring units, used in unit files.
+
+
+
+
+
+ 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 manager and other programs and environment
+ variable-compatible settings.
+
+
+
+
+
+ EFI variables
+
+ EFI variables understood by
+ systemd-boot7
+ and other programs.
+
+
+
+
+
+ UDEV directives
+
+ Directives for configuring systemd units through the udev database.
+
+
+
+
+
+ Network directives
+
+ Directives for configuring network links through the net-setup-link udev builtin and networks
+ through systemd-networkd.
+
+
+
+
+
+ Journal fields
+
+ Fields in the journal events with a well known meaning.
+
+
+
+
+
+ PAM configuration directives
+
+ Directives for configuring PAM behaviour.
+
+
+
+
+
+ /etc/crypttab and
+ /etc/fstab options
+
+ Options which influence mounted filesystems and encrypted volumes.
+
+
+
+
+
+ systemd.nspawn5
+ directives
+
+ Directives for configuring systemd-nspawn containers.
+
+
+
+
+
+ Program configuration options
+
+ Directives for configuring the behaviour of the systemd process and other tools through
+ configuration files.
+
+
+
+
+
+ Command line options
+
+ Command-line options accepted by programs in the systemd suite.
+
+
+
+
+
+ Constants
+
+ Various constant used and/or defined by systemd.
+
+
+
+
+
+ Miscellaneous options and directives
+
+ Other configuration elements which don't fit in any of the above groups.
+
+
+
+
+
+ Files and directories
+
+ Paths and file names referred to in the documentation.
+
+
+
+
+
+ D-Bus interfaces
+
+ Interfaces exposed over D-Bus.
+
+
+
+
+
+ D-Bus methods
+
+ Methods exposed in the D-Bus interface.
+
+
+
+
+
+ D-Bus properties
+
+ Properties exposed in the D-Bus interface.
+
+
+
+
+
+ D-Bus signals
+
+ Signals emitted in the D-Bus interface.
+
+
+
+
+
+ Colophon
+
+
+
diff --git a/man/meson.build b/man/meson.build
index 215b8eeb37..3a7143a4b6 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -110,9 +110,9 @@ endif
systemd_directives_xml = custom_target(
'systemd.directives.xml',
- input : source_xml_files,
+ input : ['directives-template.xml', source_xml_files],
output : 'systemd.directives.xml',
- command : [make_directive_index_py, '@OUTPUT@'] + source_xml_files)
+ command : [make_directive_index_py, '@OUTPUT@', '@INPUT@'])
nonindex_xml_files = source_xml_files + [systemd_directives_xml]
systemd_index_xml = custom_target(
diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py
index ae00c8cab2..26561a2456 100755
--- a/tools/make-directive-index.py
+++ b/tools/make-directive-index.py
@@ -7,198 +7,6 @@ import re
from xml_helper import xml_parse, xml_print, tree
from copy import deepcopy
-TEMPLATE = '''\
-
-
-
- systemd.directives
- systemd
-
-
-
- systemd.directives
- 7
-
-
-
- systemd.directives
- Index of configuration directives
-
-
-
- Unit directives
-
- Directives for configuring units, used in unit
- files.
-
-
-
-
-
- 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 manager
- and other programs and environment variable-compatible settings.
-
-
-
-
-
- EFI variables
-
- EFI variables understood by
- systemd-boot7
- and other programs.
-
-
-
-
-
- UDEV directives
-
- Directives for configuring systemd units through the
- udev database.
-
-
-
-
-
- Network directives
-
- Directives for configuring network links through the
- net-setup-link udev builtin and networks through
- systemd-networkd.
-
-
-
-
-
- Journal fields
-
- Fields in the journal events with a well known meaning.
-
-
-
-
-
- PAM configuration directives
-
- Directives for configuring PAM behaviour.
-
-
-
-
-
- /etc/crypttab and
- /etc/fstab options
-
- Options which influence mounted filesystems and
- encrypted volumes.
-
-
-
-
-
- systemd.nspawn5
- directives
-
- Directives for configuring systemd-nspawn containers.
-
-
-
-
-
- Program configuration options
-
- Directives for configuring the behaviour of the
- systemd process and other tools through configuration files.
-
-
-
-
-
- Command line options
-
- Command-line options accepted by programs in the
- systemd suite.
-
-
-
-
-
- Constants
-
- Various constant used and/or defined by systemd.
-
-
-
-
-
- Miscellaneous options and directives
-
- Other configuration elements which don't fit in
- any of the above groups.
-
-
-
-
-
- Files and directories
-
- Paths and file names referred to in the
- documentation.
-
-
-
-
-
- D-Bus interfaces
-
- Interfaces exposed over D-Bus.
-
-
-
-
-
- D-Bus methods
-
- Methods exposed in the D-Bus interface.
-
-
-
-
-
- D-Bus properties
-
- Properties exposed in the D-Bus interface.
-
-
-
-
-
- D-Bus signals
-
- Signals emitted in the D-Bus interface.
-
-
-
-
-
- Colophon
-
-
-
-'''
-
COLOPHON = '''\
This index contains {count} entries in {sections} sections,
referring to {pages} individual manual pages.
@@ -330,9 +138,9 @@ def _make_page(template, directive_groups, formatting):
return template
-def make_page(*xml_files):
+def make_page(template_path, xml_files):
"Extract directives from xml_files and return XML index tree."
- template = tree.fromstring(TEMPLATE)
+ template = xml_parse(template_path)
names = [vl.get('id') for vl in template.iterfind('.//variablelist')]
directive_groups = {name:collections.defaultdict(list)
for name in names}
@@ -347,4 +155,7 @@ def make_page(*xml_files):
if __name__ == '__main__':
with open(sys.argv[1], 'wb') as f:
- f.write(xml_print(make_page(*sys.argv[2:])))
+ template_path = sys.argv[2]
+ xml_files = sys.argv[3:]
+ xml = make_page(template_path, xml_files)
+ f.write(xml_print(xml))