X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=make-directive-index.py;h=468d14da75c53677a02588deca607c4343772217;hp=396947b3030f6c271fcec46d55e911abfbbc3a8a;hb=3ae83f9896bff49679c8a60e6ff9520557df8b16;hpb=845c53246f73a505f12bb7f685a530045fa60a40 diff --git a/make-directive-index.py b/make-directive-index.py index 396947b30..468d14da7 100755 --- a/make-directive-index.py +++ b/make-directive-index.py @@ -21,6 +21,7 @@ import sys import collections import re from xml_helper import * +from copy import deepcopy TEMPLATE = '''\ @@ -226,19 +227,20 @@ def _make_section(template, name, directives, formatting): for varname, manpages in sorted(directives.items()): entry = tree.SubElement(varlist, 'varlistentry') term = tree.SubElement(entry, 'term') - term.append(formatting[varname]) + display = deepcopy(formatting[varname]) + term.append(display) para = tree.SubElement(tree.SubElement(entry, 'listitem'), 'para') b = None for manpage, manvolume in sorted(set(manpages)): - if b is not None: - b.tail = ', ' - b = tree.SubElement(para, 'citerefentry') - c = tree.SubElement(b, 'refentrytitle') - c.text = manpage - d = tree.SubElement(b, 'manvolnum') - d.text = manvolume + if b is not None: + b.tail = ', ' + b = tree.SubElement(para, 'citerefentry') + c = tree.SubElement(b, 'refentrytitle') + c.text = manpage + d = tree.SubElement(b, 'manvolnum') + d.text = manvolume entry.tail = '\n\n' def _make_colophon(template, groups): @@ -264,7 +266,7 @@ def _make_page(template, directive_groups, formatting): } """ for name, directives in directive_groups.items(): - _make_section(template, name, directives, formatting) + _make_section(template, name, directives, formatting) _make_colophon(template, directive_groups.values())