[overlord-commits] Overlord SVN: r380 - in cdl/trunk/docs/docbook: samplesguide/src/main and 4 other directories.

overlord-commits at lists.jboss.org overlord-commits at lists.jboss.org
Wed Oct 15 11:46:11 EDT 2008


Author: jeff.yuchang
Date: 2008-10-15 11:46:11 -0400 (Wed, 15 Oct 2008)
New Revision: 380

Added:
   cdl/trunk/docs/docbook/samplesguide/src/main/xslt/
   cdl/trunk/docs/docbook/samplesguide/src/main/xslt/pdf.xsl
   cdl/trunk/docs/docbook/userguide/src/main/xslt/
   cdl/trunk/docs/docbook/userguide/src/main/xslt/pdf.xsl
Modified:
   cdl/trunk/docs/docbook/samplesguide/pom.xml
   cdl/trunk/docs/docbook/userguide/pom.xml
Log:
* Add custom pdf xsl, override some attributes, like remove the blank pages between chapter. 



Modified: cdl/trunk/docs/docbook/samplesguide/pom.xml
===================================================================
--- cdl/trunk/docs/docbook/samplesguide/pom.xml	2008-10-14 17:58:04 UTC (rev 379)
+++ cdl/trunk/docs/docbook/samplesguide/pom.xml	2008-10-15 15:46:11 UTC (rev 380)
@@ -59,7 +59,7 @@
 		            <formats>
 		                <format>
 		                    <formatName>pdf</formatName>
-		                    <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+		                    <stylesheetResource>file://${basedir}/src/main/xslt/pdf.xsl</stylesheetResource>
 				            <finalName>SamplesGuide.pdf</finalName>
 		                </format>
 						<format>

Added: cdl/trunk/docs/docbook/samplesguide/src/main/xslt/pdf.xsl
===================================================================
--- cdl/trunk/docs/docbook/samplesguide/src/main/xslt/pdf.xsl	                        (rev 0)
+++ cdl/trunk/docs/docbook/samplesguide/src/main/xslt/pdf.xsl	2008-10-15 15:46:11 UTC (rev 380)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.72.0/fo/docbook.xsl" />
+  <xsl:import href="classpath:/xslt/org/jboss/pdf.xsl" />
+
+  <!-- Override the default font settings -->
+  <xsl:param name="body.font.family" select="'Times New Roman, serif'" />
+  <xsl:param name="monospace.font.family" select="'DejaVu Sans Mono, monospace'" />
+  <xsl:param name="sans.font.family" select="'Arial, sans-serif'" />
+  <xsl:param name="title.font.family" select="$body.font.family" />
+  <xsl:param name="programlisting.font" select="$monospace.font.family" />
+  <xsl:param name="programlisting.font.size" select="'75%'" />
+
+  <!-- Remove the blank pages between the chapters -->
+  <xsl:param name="double.sided" select="0" />
+
+  <!-- Use SVG for callout images instead of PNG -->
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension" select="'.svg'" />
+
+  <!-- Hide URL -->
+  <xsl:param name="ulink.show" select="0"/>
+
+  <!-- Don't use italic font for links -->
+  <xsl:attribute-set name="xref.properties">
+    <xsl:attribute name="font-style">normal</xsl:attribute>
+  </xsl:attribute-set>
+
+  <!-- Decrease the link font size in the program listing -->
+  <xsl:attribute-set name="monospace.properties">
+    <xsl:attribute name="font-size">1em</xsl:attribute>
+    <xsl:attribute name="font-family">
+        <xsl:value-of select="$monospace.font.family"/>
+    </xsl:attribute>
+  </xsl:attribute-set>
+  
+  <!-- Add some spacing between callout listing items -->
+  <xsl:template match="callout">
+    <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+    <fo:list-item id="{$id}" space-before="1em">
+      <fo:list-item-label end-indent="label-end()">
+        <fo:block>
+          <xsl:call-template name="callout.arearefs">
+            <xsl:with-param name="arearefs" select="@arearefs"/>
+          </xsl:call-template>
+        </fo:block>
+      </fo:list-item-label>
+      <fo:list-item-body start-indent="body-start()">
+        <fo:block padding-top="0.2em">
+          <xsl:apply-templates/>
+        </fo:block>
+      </fo:list-item-body>
+    </fo:list-item>
+  </xsl:template>
+  
+  <!-- Slight baseline-shift for callouts in the program listing -->
+  <xsl:template name="callout-bug">
+    <xsl:param name="conum" select='1'/>
+    <xsl:choose>
+      <xsl:when test="$conum &lt;= $callout.graphics.number.limit">
+        <xsl:variable name="filename"
+                      select="concat($callout.graphics.path, $conum,
+                                     $callout.graphics.extension)"/>
+
+        <fo:external-graphic content-width="{$callout.icon.size}"
+                             width="{$callout.icon.size}"
+                             padding="0.0em" margin="0.0em"
+                             baseline-shift="-0.375em">
+          <xsl:attribute name="src">
+            <xsl:choose>
+              <xsl:when test="$passivetex.extensions != 0
+                              or $fop.extensions != 0
+                              or $arbortext.extensions != 0">
+                <xsl:value-of select="$filename"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>url(</xsl:text>
+                <xsl:value-of select="$filename"/>
+                <xsl:text>)</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:external-graphic>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
+

Modified: cdl/trunk/docs/docbook/userguide/pom.xml
===================================================================
--- cdl/trunk/docs/docbook/userguide/pom.xml	2008-10-14 17:58:04 UTC (rev 379)
+++ cdl/trunk/docs/docbook/userguide/pom.xml	2008-10-15 15:46:11 UTC (rev 380)
@@ -59,7 +59,7 @@
 		            <formats>
 		                <format>
 		                    <formatName>pdf</formatName>
-		                    <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+		                    <stylesheetResource>file://${basedir}/src/main/xslt/pdf.xsl</stylesheetResource>
 				            <finalName>UserGuide.pdf</finalName>
 		                </format>
 						<format>

Added: cdl/trunk/docs/docbook/userguide/src/main/xslt/pdf.xsl
===================================================================
--- cdl/trunk/docs/docbook/userguide/src/main/xslt/pdf.xsl	                        (rev 0)
+++ cdl/trunk/docs/docbook/userguide/src/main/xslt/pdf.xsl	2008-10-15 15:46:11 UTC (rev 380)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.72.0/fo/docbook.xsl" />
+  <xsl:import href="classpath:/xslt/org/jboss/pdf.xsl" />
+
+  <!-- Override the default font settings -->
+  <xsl:param name="body.font.family" select="'Times New Roman, serif'" />
+  <xsl:param name="monospace.font.family" select="'DejaVu Sans Mono, monospace'" />
+  <xsl:param name="sans.font.family" select="'Arial, sans-serif'" />
+  <xsl:param name="title.font.family" select="$body.font.family" />
+  <xsl:param name="programlisting.font" select="$monospace.font.family" />
+  <xsl:param name="programlisting.font.size" select="'75%'" />
+
+  <!-- Remove the blank pages between the chapters -->
+  <xsl:param name="double.sided" select="0" />
+
+  <!-- Use SVG for callout images instead of PNG -->
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension" select="'.svg'" />
+
+  <!-- Hide URL -->
+  <xsl:param name="ulink.show" select="0"/>
+
+  <!-- Don't use italic font for links -->
+  <xsl:attribute-set name="xref.properties">
+    <xsl:attribute name="font-style">normal</xsl:attribute>
+  </xsl:attribute-set>
+
+  <!-- Decrease the link font size in the program listing -->
+  <xsl:attribute-set name="monospace.properties">
+    <xsl:attribute name="font-size">1em</xsl:attribute>
+    <xsl:attribute name="font-family">
+        <xsl:value-of select="$monospace.font.family"/>
+    </xsl:attribute>
+  </xsl:attribute-set>
+  
+  <!-- Add some spacing between callout listing items -->
+  <xsl:template match="callout">
+    <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+    <fo:list-item id="{$id}" space-before="1em">
+      <fo:list-item-label end-indent="label-end()">
+        <fo:block>
+          <xsl:call-template name="callout.arearefs">
+            <xsl:with-param name="arearefs" select="@arearefs"/>
+          </xsl:call-template>
+        </fo:block>
+      </fo:list-item-label>
+      <fo:list-item-body start-indent="body-start()">
+        <fo:block padding-top="0.2em">
+          <xsl:apply-templates/>
+        </fo:block>
+      </fo:list-item-body>
+    </fo:list-item>
+  </xsl:template>
+  
+  <!-- Slight baseline-shift for callouts in the program listing -->
+  <xsl:template name="callout-bug">
+    <xsl:param name="conum" select='1'/>
+    <xsl:choose>
+      <xsl:when test="$conum &lt;= $callout.graphics.number.limit">
+        <xsl:variable name="filename"
+                      select="concat($callout.graphics.path, $conum,
+                                     $callout.graphics.extension)"/>
+
+        <fo:external-graphic content-width="{$callout.icon.size}"
+                             width="{$callout.icon.size}"
+                             padding="0.0em" margin="0.0em"
+                             baseline-shift="-0.375em">
+          <xsl:attribute name="src">
+            <xsl:choose>
+              <xsl:when test="$passivetex.extensions != 0
+                              or $fop.extensions != 0
+                              or $arbortext.extensions != 0">
+                <xsl:value-of select="$filename"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>url(</xsl:text>
+                <xsl:value-of select="$filename"/>
+                <xsl:text>)</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:attribute>
+        </fo:external-graphic>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+</xsl:stylesheet>
+




More information about the overlord-commits mailing list