Эх сурвалжийг харах

In preface and chapter pages, output the introductory text, if any, before the TOC.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/new-xsl@8079 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia 18 жил өмнө
parent
commit
4476fd7dbf
1 өөрчлөгдсөн 70 нэмэгдсэн , 2 устгасан
  1. 70 2
      xhtml/lfs-sections.xsl

+ 70 - 2
xhtml/lfs-sections.xsl

@@ -4,12 +4,80 @@
                 xmlns="http://www.w3.org/1999/xhtml"
                 version="1.0">
 
-  <!-- This stylesheet controls how sections are handled -->
+  <!-- This stylesheet controls how preface, chapter, and sections are handled -->
 
     <!-- Chunk the first top-level section? 1 = yes, 0 = no
-         If chapters TOC are generated, this must be 1. -->
+         If preface and chapters TOC are generated, this must be 1. -->
   <xsl:param name="chunk.first.sections" select="1"/>
 
+    <!-- preface:
+           Process the child elemements before generating the TOC -->
+    <!-- The original template is in {docbook-xsl}/xhtml/components.xsl -->
+  <xsl:template match="preface">
+    <xsl:call-template name="id.warning"/>
+    <div>
+      <xsl:apply-templates select="." mode="class.attribute"/>
+      <xsl:call-template name="dir">
+        <xsl:with-param name="inherit" select="1"/>
+      </xsl:call-template>
+      <xsl:call-template name="language.attribute"/>
+      <xsl:if test="$generate.id.attributes != 0">
+        <xsl:attribute name="id">
+          <xsl:call-template name="object.id"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:call-template name="component.separator"/>
+      <xsl:call-template name="preface.titlepage"/>
+      <xsl:variable name="toc.params">
+        <xsl:call-template name="find.path.params">
+          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:apply-templates/>
+      <xsl:if test="contains($toc.params, 'toc')">
+        <xsl:call-template name="component.toc">
+          <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="component.toc.separator"/>
+      </xsl:if>
+      <xsl:call-template name="process.footnotes"/>
+    </div>
+  </xsl:template>
+
+    <!-- chapter:
+           Process the child elemements before generating the TOC -->
+    <!-- The original template is in {docbook-xsl}/xhtml/components.xsl -->
+  <xsl:template match="chapter">
+    <xsl:call-template name="id.warning"/>
+    <div>
+      <xsl:apply-templates select="." mode="class.attribute"/>
+      <xsl:call-template name="dir">
+        <xsl:with-param name="inherit" select="1"/>
+      </xsl:call-template>
+      <xsl:call-template name="language.attribute"/>
+      <xsl:if test="$generate.id.attributes != 0">
+        <xsl:attribute name="id">
+          <xsl:call-template name="object.id"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:call-template name="component.separator"/>
+      <xsl:call-template name="chapter.titlepage"/>
+      <xsl:variable name="toc.params">
+        <xsl:call-template name="find.path.params">
+          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <xsl:apply-templates/>
+      <xsl:if test="contains($toc.params, 'toc')">
+        <xsl:call-template name="component.toc">
+          <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
+        </xsl:call-template>
+        <xsl:call-template name="component.toc.separator"/>
+      </xsl:if>
+      <xsl:call-template name="process.footnotes"/>
+    </div>
+  </xsl:template>
+
     <!-- sect1:
            When there is a role attibute, use it as the class value.
            Process the SVN keywords found in sect1info as a footnote.