]> granicus.if.org Git - docbook-dsssl/commitdiff
Added code to handle acknowledgements in book and part. The element is processed
authorMauritz Jeanson <mj@johanneberg.com>
Thu, 12 Mar 2009 17:40:15 +0000 (17:40 +0000)
committerMauritz Jeanson <mj@johanneberg.com>
Thu, 12 Mar 2009 17:40:15 +0000 (17:40 +0000)
similarly to dedication. All acknowledgements will appear as front matter, after
any dedications.

xsl/common/titles.xsl
xsl/html/component.xsl
xsl/html/division.xsl
xsl/html/titlepage.templates.xml
xsl/html/titlepage.xsl
xsl/html/xref.xsl

index 9495e34ffaa7409a99518be12a374bc1448a8283..4be93ae128772c634c21be60bdb7a1e90f24c6d8 100644 (file)
@@ -157,6 +157,22 @@ title of the element. This does not include the label.
   </xsl:choose>
 </xsl:template>
 
+<xsl:template match="acknowledgements" mode="title.markup">
+  <xsl:param name="allow-anchors" select="0"/>
+  <xsl:choose>
+    <xsl:when test="title">
+      <xsl:apply-templates select="(title|info/title)[1]" mode="title.markup">
+        <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="'Acknowledgements'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="colophon" mode="title.markup">
   <xsl:param name="allow-anchors" select="0"/>
   <xsl:choose>
index 634f220534cc9147d165a1cdd36c08f93e1c24c2..7236d13ee8065449eb5669229b9c2a39da63fd8f 100644 (file)
 
 <!-- ==================================================================== -->
 
+<xsl:template match="acknowledgements" mode="acknowledgements">
+  <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:call-template name="acknowledgements.titlepage"/>
+    <xsl:apply-templates/>
+    <xsl:call-template name="process.footnotes"/>
+  </div>
+</xsl:template>
+
+<xsl:template match="acknowledgements/title|acknowledgements/info/title" 
+              mode="titlepage.mode" priority="2">
+  <xsl:call-template name="component.title">
+    <xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="acknowledgements/subtitle|acknowledgements/info/subtitle" 
+              mode="titlepage.mode" priority="2">
+  <xsl:call-template name="component.subtitle">
+    <xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="acknowledgements"></xsl:template> <!-- see mode="acknowledgements" -->
+<xsl:template match="acknowledgements/title"></xsl:template>
+<xsl:template match="acknowledgements/subtitle"></xsl:template>
+<xsl:template match="acknowledgements/titleabbrev"></xsl:template>
+
+<!-- ==================================================================== -->
+
 <xsl:template match="colophon">
   <xsl:call-template name="id.warning"/>
 
index d7b42ddb36ebe77a9f97868cec724d806a81b9a3..1d2e4c2ca022c3d9ee753f95f2cf6a6773ea3544 100644 (file)
@@ -75,6 +75,7 @@
     <xsl:call-template name="book.titlepage"/>
 
     <xsl:apply-templates select="dedication" mode="dedication"/>
+    <xsl:apply-templates select="acknowledgements" mode="acknowledgements"/>
 
     <xsl:variable name="toc.params">
       <xsl:call-template name="find.path.params">
index 664dc14e2e500a85a78ba672e757df61c96890c1..926b3c31f90db66a86c33b6c973217230d67cbb2 100644 (file)
 
 <!-- ==================================================================== -->
 
+<t:titlepage t:element="acknowledgements" t:wrapper="div" class="titlepage">
+    <t:titlepage-content t:side="recto">
+    <title
+          t:force="1"
+          t:named-template="component.title"
+          param:node="ancestor-or-self::acknowledgements[1]"/>
+    <subtitle/>
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
 <t:titlepage t:element="preface" t:wrapper="div" class="titlepage">
   <t:titlepage-content t:side="recto">
     <title/>
index 8c344fa2b6550ed2413c50372ac66126b6a00c20..16f5c8db47bd6eb251c420dc09e2bf166260450e 100644 (file)
@@ -38,6 +38,9 @@
 <xsl:attribute-set name="dedication.titlepage.recto.style"/>
 <xsl:attribute-set name="dedication.titlepage.verso.style"/>
 
+<xsl:attribute-set name="acknowledgements.titlepage.recto.style"/>
+<xsl:attribute-set name="acknowledgements.titlepage.verso.style"/>
+
 <xsl:attribute-set name="preface.titlepage.recto.style"/>
 <xsl:attribute-set name="preface.titlepage.verso.style"/>
 
 
 <xsl:template match="authorgroup" mode="titlepage.mode">
   <div>
+    <xsl:if test="parent::refentryinfo">
+      <h2>Authors</h2>
+    </xsl:if>
+      
     <xsl:apply-templates select="." mode="class.attribute"/>
     <xsl:call-template name="anchor"/>
     <xsl:apply-templates mode="titlepage.mode"/>
 </xsl:template>
 
 <xsl:template match="copyright" mode="titlepage.mode">
+
+  <xsl:if test="generate-id() = generate-id(//refentryinfo/copyright[1])">
+    <h2>Copyright</h2>
+  </xsl:if>
+
   <p>
     <xsl:apply-templates select="." mode="class.attribute"/>
     <xsl:call-template name="gentext">
index 035fc67a0ae5548ea0206b38f8c6defe30e7092c..01ebe3364c1356e09503f9259c4536fa4fbc5a63 100644 (file)
   <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
 </xsl:template>
 
-<xsl:template match="dedication|preface|chapter|appendix|article" mode="xref-to">
+<xsl:template match="dedication|acknowledgements|preface|chapter|appendix|article" mode="xref-to">
   <xsl:param name="referrer"/>
   <xsl:param name="xrefstyle"/>
   <xsl:param name="verbose" select="1"/>
                                        |ancestor::preface
                                        |ancestor::partintro
                                        |ancestor::dedication
+                                       |ancestor::acknowledgements
                                        |ancestor::colophon
                                        |ancestor::bibliography
                                        |ancestor::index