瀏覽代碼

Added revhistory support on PDF book titlepage.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/new-xsl@8104 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia 18 年之前
父節點
當前提交
79fd5ef642
共有 2 個文件被更改,包括 63 次插入3 次删除
  1. 52 0
      pdf/lfs-mixed.xsl
  2. 11 3
      pdf/lfs-pagesetup.xsl

+ 52 - 0
pdf/lfs-mixed.xsl

@@ -364,4 +364,56 @@
     <xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
   </xsl:attribute-set>
 
+
+  <!-- Revision History -->
+
+    <!-- revhistory titlepage:
+           Self-made template to add missing support on bookinfo. -->
+  <xsl:template match="revhistory" mode="book.titlepage.verso.auto.mode">
+    <fo:block space-before.optimum="2em"
+              space-before.minimum="1.5em"
+              space-before.maximum="2.5em">
+      <xsl:apply-templates select="." mode="book.titlepage.verso.mode"/>
+    </fo:block>
+  </xsl:template>
+
+    <!-- revhitory title properties -->
+  <xsl:attribute-set name="revhistory.title.properties">
+    <xsl:attribute name="text-align">center</xsl:attribute>
+    <xsl:attribute name="font-weight">bold</xsl:attribute>
+  </xsl:attribute-set>
+
+    <!-- revhistory/revision mode titlepage.mode:
+           Removed authorinitials and author. -->
+    <!-- The original template is in {docbook-xsl}/fo/titlepage.xsl -->
+  <xsl:template match="revhistory/revision" mode="titlepage.mode">
+    <xsl:variable name="revnumber" select="revnumber"/>
+    <xsl:variable name="revdate"   select="date"/>
+    <xsl:variable name="revauthor" select="authorinitials|author"/>
+    <xsl:variable name="revremark" select="revremark|revdescription"/>
+    <fo:table-row>
+      <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+        <fo:block>
+          <xsl:if test="$revnumber">
+            <xsl:call-template name="gentext">
+              <xsl:with-param name="key" select="'Revision'"/>
+            </xsl:call-template>
+            <xsl:call-template name="gentext.space"/>
+            <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/>
+          </xsl:if>
+        </fo:block>
+      </fo:table-cell>
+      <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+        <fo:block>
+          <xsl:apply-templates select="$revdate[1]"/>
+        </fo:block>
+      </fo:table-cell>
+      <fo:table-cell xsl:use-attribute-sets="revhistory.table.cell.properties">
+        <fo:block>
+          <xsl:apply-templates select="$revremark[1]"/>
+        </fo:block>
+      </fo:table-cell>
+    </fo:table-row>
+  </xsl:template>
+
 </xsl:stylesheet>

+ 11 - 3
pdf/lfs-pagesetup.xsl

@@ -37,6 +37,11 @@
     <!-- Adjust the left margin for titles. -->
   <xsl:param name="title.margin.left">-0.8pc</xsl:param>
 
+    <!-- Default table width on tables that do not specify an alternate
+         width using the dbfo processing instruction.
+         This value is used also on bookinfo/revhistory table. -->
+  <xsl:param name="default.table.width" select="'70%'"/>
+
     <!-- Properties for component titles -->
   <xsl:attribute-set name="component.title.properties">
     <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
@@ -75,7 +80,7 @@
          Be sure that no uneeded fo:marker are generated. -->
   <xsl:param name="marker.section.level" select="-1"></xsl:param>
 
-     <!-- Force sect1 onto a new page -->
+     <!-- Force package's sect1 onto a new page -->
   <xsl:attribute-set name="section.level1.properties">
     <xsl:attribute name="break-before">
       <xsl:choose>
@@ -92,7 +97,8 @@
   </xsl:attribute-set>
 
     <!-- book title:
-          Centered the title and removed unused code. -->
+          Centered the title and removed unused code.
+          Added missing revhistory support. -->
     <!-- The original template is in {docbook-xsl}/fo/titlepage.templates.xsl -->
   <xsl:template name="book.titlepage">
     <fo:block margin-top="3in">
@@ -103,12 +109,14 @@
       <fo:block>
         <xsl:call-template name="book.titlepage.before.verso"/>
         <xsl:call-template name="book.titlepage.verso"/>
+        <xsl:apply-templates mode="book.titlepage.verso.auto.mode"
+                             select="bookinfo/revhistory"/>
       </fo:block>
       <xsl:call-template name="book.titlepage.separator"/>
     </fo:block>
   </xsl:template>
 
-    <!-- book title:
+    <!-- book title separator:
            Drop a blank page after book title. -->
     <!-- The original template is in {docbook-xsl}/fo/titlepage.templates.xsl -->
   <xsl:template name="book.titlepage.separator"/>