man: put all pages which mention a specifier in the index

I wasn't 100% convinced that this is the right thing to do, hence the separate
commit. But e.g. for paths we index all mentions, so I think it's reasonable to
do the same here.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-05-07 15:05:29 +02:00
parent 6552874506
commit 6dbf40256b
3 changed files with 14 additions and 9 deletions

View File

@ -444,9 +444,9 @@
created. (See created. (See
<citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for more information.) This option is mandatory. Note that the usual specifier expansion is applied for more information.) This option is mandatory. Note that the usual specifier expansion is applied
to this setting, literal percent characters should hence be written as <literal>%%</literal>. If this to this setting, literal percent characters should hence be written as <literal
mount is a bind mount and the specified path does not exist yet it is created as class='specifiers'>%%</literal>. If this mount is a bind mount and the specified path does not exist
directory.</para></listitem> yet it is created as directory.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@ -469,7 +469,7 @@
<listitem><para>Mount options to use when mounting. This takes a comma-separated list of options. This setting <listitem><para>Mount options to use when mounting. This takes a comma-separated list of options. This setting
is optional. Note that the usual specifier expansion is applied to this setting, literal percent characters is optional. Note that the usual specifier expansion is applied to this setting, literal percent characters
should hence be written as <literal>%%</literal>.</para></listitem> should hence be written as <literal class='specifiers'>%%</literal>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -184,11 +184,13 @@
project='man-pages'><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry> for project='man-pages'><refentrytitle>swapon</refentrytitle><manvolnum>8</manvolnum></citerefentry> for
details. If this refers to a device node, a dependency on the respective device unit is automatically details. If this refers to a device node, a dependency on the respective device unit is automatically
created. (See created. (See
<citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
information.) If this refers to a file, a dependency on the respective mount unit is automatically for more information.) If this refers to a file, a dependency on the respective mount unit is
created. (See <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> automatically created. (See
for more information.) This option is mandatory. Note that the usual specifier expansion is applied to this <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
setting, literal percent characters should hence be written as <literal>%%</literal>.</para></listitem> more information.) This option is mandatory. Note that the usual specifier expansion is applied to
this setting, literal percent characters should hence be written as
<literal class='specifiers'>%%</literal>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -95,6 +95,9 @@ def _extract_directives(directive_groups, formatting, page):
continue continue
storfile[name.text].append((pagename, section)) storfile[name.text].append((pagename, section))
formatting[name.text] = name formatting[name.text] = name
for name in t.iterfind(".//literal[@class='specifiers']"):
storfile[name.text].append((pagename, section))
formatting[name.text] = name
def _make_section(template, name, directives, formatting): def _make_section(template, name, directives, formatting):
varlist = template.find(".//*[@id='{}']".format(name)) varlist = template.find(".//*[@id='{}']".format(name))