stylesheets: fix generation of footnotes

There was two problems:
- the sect1 template did not process the footnote
- footnote processing needed to use a template matching
  footnote/para[1], but we had a template matching para
  at a higher precendence level.
So:
- call process.footnotes at the end of the sect1 template
- Add a templates matching footnote/para[1] at the same import
  level as the template matching para (this just call the original
  template)
We also add a priority 1 to the sect1 template in chunk-code.xsl,
although it is not strictly necessary. This is what upstream
recommends...
This commit is contained in:
Pierre Labastie 2025-03-11 15:45:14 +01:00
parent a2bf74a9b5
commit e2789b4c66
3 changed files with 17 additions and 3 deletions

View File

@ -27,8 +27,12 @@
Prevent creation of dummy sect1 files used to emulate sub-chapters. Prevent creation of dummy sect1 files used to emulate sub-chapters.
The original template is in {docbook-xsl}/xhtml/chunk-code.xsl The original template is in {docbook-xsl}/xhtml/chunk-code.xsl
It also matches other sect* tags. The code for those tags are It also matches other sect* tags. The code for those tags are
unchanged. --> unchanged. Note that the priority attribute is not strictly
<xsl:template match="sect1"> required, because the original template is less restrictive in
matching, so has less precedence. But in case the docbook dev
add a match="sect1" template in their chunk-code.xsl, then it will
be necessary!-->
<xsl:template match="sect1" priority="1">
<xsl:variable name="ischunk"> <xsl:variable name="ischunk">
<xsl:call-template name="chunk"/> <xsl:call-template name="chunk"/>
</xsl:variable> </xsl:variable>

View File

@ -43,6 +43,16 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<!-- footnote/para[1]: this template is in {docbook-xsl}/xhtml/footnote.xsl
which is imported. This means that template has less precedence
than the above one. To have higher precedence, it must be at
the same import level (then, since it is more restrictive, it is
applied preferably to the above).-->
<xsl:template match="footnote/para[1]">
<!-- just use the original template -->
<xsl:apply-imports/>
</xsl:template>
<!-- screen: <!-- screen:
Changed class attribute asignament to fit our look needs. Changed class attribute asignament to fit our look needs.
Removed unused line numbering support. --> Removed unused line numbering support. -->

View File

@ -166,7 +166,7 @@
</xsl:choose> </xsl:choose>
<xsl:call-template name="language.attribute"/> <xsl:call-template name="language.attribute"/>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:apply-templates select="sect1info" mode="svn-keys"/> <xsl:call-template name="process.footnotes"/>
</div> </div>
</xsl:template> </xsl:template>