[lfs] branch trunk updated: stylesheets: fix generation of footnotes

"Git Owner" ([email protected] via lfs-book Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.book
Message-ID <174170531747.1915.528972013263938178@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository lfs.

The following commit(s) were added to refs/heads/trunk by this push:
     new e2789b4c6 stylesheets: fix generation of footnotes
e2789b4c6 is described below

commit e2789b4c66f9e762fb826e6abc24d68e6c2086bb
Author: Pierre Labastie <[email protected]>
AuthorDate: Tue Mar 11 15:45:14 2025 +0100

    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...
---
 stylesheets/lfs-xsl/chunk-master.xsl       |  8 ++++++--
 stylesheets/lfs-xsl/xhtml/lfs-mixed.xsl    | 10 ++++++++++
 stylesheets/lfs-xsl/xhtml/lfs-sections.xsl |  2 +-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/stylesheets/lfs-xsl/chunk-master.xsl b/stylesheets/lfs-xsl/chunk-master.xsl
index 029332162..b353e75ca 100644
--- a/stylesheets/lfs-xsl/chunk-master.xsl
+++ b/stylesheets/lfs-xsl/chunk-master.xsl
@@ -27,8 +27,12 @@
          Prevent creation of dummy sect1 files used to emulate sub-chapters.
          The original template is in {docbook-xsl}/xhtml/chunk-code.xsl
          It also matches other sect* tags. The code for those tags are
-         unchanged. -->
-  <xsl:template match="sect1">
+         unchanged. Note that the priority attribute is not strictly
+         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:call-template name="chunk"/>
     </xsl:variable>
diff --git a/stylesheets/lfs-xsl/xhtml/lfs-mixed.xsl b/stylesheets/lfs-xsl/xhtml/lfs-mixed.xsl
index 59859c12e..d33cd4f12 100644
--- a/stylesheets/lfs-xsl/xhtml/lfs-mixed.xsl
+++ b/stylesheets/lfs-xsl/xhtml/lfs-mixed.xsl
@@ -43,6 +43,16 @@
     </xsl:choose>
   </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:
            Changed class attribute asignament to fit our look needs.
            Removed unused line numbering support. -->
diff --git a/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl b/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl
index b13e5e11b..0ecfaa4f6 100644
--- a/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl
+++ b/stylesheets/lfs-xsl/xhtml/lfs-sections.xsl
@@ -166,7 +166,7 @@
       </xsl:choose>
       <xsl:call-template name="language.attribute"/>
       <xsl:apply-templates/>
-      <xsl:apply-templates select="sect1info" mode="svn-keys"/>
+      <xsl:call-template name="process.footnotes"/>
     </div>
   </xsl:template>
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.