Re: <indexterm> with <secondary>

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: <indexterm> with <secondary>
Date: 2017-10-26 06:40:11
Message-ID: 54391dfd-7f17-ead6-76be-0957ec2e67cb@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hello Tom,
25.10.2017 23:23, Tom Lane writes:
>
>> 2. To remove @zone specification from indexterm's.
>> Are there any reasons to specify it explicitly?
> According to my understanding, the use of "zone" means that the
> indexterm entry refers to the whole section named by the "zone" label,
> not only the physical point the entry is at. So I think our usage
> is correct in principle; for example, this would allow an index entry
> to say something like "Section 4.2" not just "page 435". In practice,
> though, the distinction seems merely pedantic: AFAICS it does not
> affect either HTML output (which always gives you a hyperlink to the
> containing section) or PDF output (which always gives you a page number).
There is also the Docbook parameter "index.links.to.section" (
http://docbook.sourceforge.net/release/xsl/1.79.1/doc/html/index.links.to.section.html
)
which affects the pedanticism of the distinction.
> So we could run around and remove the zone tags, but that still seems
> like rather a grotty answer --- maybe someday we'd want them back,
> if the doc toolchain were ever improved to make effective use of them.
>
> How complicated is the "customize the xsl template" solution?
>
> (BTW, I do not see the extra-entries bug at all in PDF output.)
Yes, the issue is with html/autoidx.xsl only.
I would choose to customize xsl for now, though the corresponding
docbook templates are not very human-friendly (for xhtml/autoidx.xsl
they are autogenerated from html/autoidx). See the patch attached. (May
be we might reformat it slightly.)
The commands used to generate the patch are more simpler:

wget http://docbook.sourceforge.net/release/xsl/1.79.1/xhtml/autoidx.xsl
-O - | grep -Pzo '(?s)<xsl:template match="indexterm"
mode="index-(primary|secondary|tertiary)">(.*?)</xsl:template>\s' | sed
-e "s/\x0//" -e "s/\$refs\[(at)zone != '' or
generate-id()/\$refs[generate-id()/" >> stylesheet-html-common.xsl
perl -0777 -i -pe 's#\n</xsl:stylesheet>##' stylesheet-html-common.xsl;
echo -e '\n</xsl:stylesheet>' >>stylesheet-html-common.xsl

Nonertheless, it might be better solution as we can leave all the zone
references intact and preserve the freedom to change our mind later.

Best regards,
------
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
fix-html-autoidx.patch text/x-patch 50.9 KB

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message fabiolaquijano 2017-10-26 17:23:01 Collate
Previous Message Tom Lane 2017-10-25 20:23:20 Re: <indexterm> with <secondary>