Skip to content

Commit

Permalink
Style sheets: fiks docbook-xsl feil i autoidx
Browse files Browse the repository at this point in the history
Malen kalt generate-basic-index i
{docbook-xsl}/xhtml/autoidx.xsl har en feil som genererer et div-element
med feil xmlns:xlink-attributt. Se
docbook/xslt10-stylesheets#239.
I stedet for å fikse docbook-xsl, som ville fungere bare i LFS (men vi
ønsker å kunne gjengi på andre distroer), kopier den defekte malen
til våre tilpasningsfiler (lfs-index.xsl), slik at denne brukes.
Vi kan også forenkle det mye siden vi ikke trenger alle sakene
dekket i generate-basic-indexl.
  • Loading branch information
Gusse500 committed Jan 18, 2024
1 parent ff33c85 commit 47ec574
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions stylesheets/lfs-xsl/xhtml/lfs-index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@
<xsl:text>longindex.html</xsl:text>
</xsl:template>

<!-- The original template in {docbook-xsl}/xhtml/autoidx.xsl has
a bug that generates a <div> with a wrong xmlns:xlink attribute,
so copy it here (and simplify it a lot)-->
<xsl:template name="generate-basic-index">
<xsl:param name="scope" select="NOTANODE"/>

<xsl:variable name="terms" select="//indexterm
[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,
&uppercase;
)
) [&scope;][1]) = 1]"/>
<div class="index">
<xsl:apply-templates select="$terms" mode="index-div-basic">
<xsl:with-param name="position" select="position()"/>
<xsl:with-param name="scope" select="$scope"/>
<xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
</xsl:apply-templates>
</div>
</xsl:template>

<!-- Divisions:
Override the default division titles, translating them from the default
'A', 'B', etc. to 'Packages', 'Programs', etc.
Expand Down

0 comments on commit 47ec574

Please sign in to comment.