[jboss-cvs] JBossAS SVN: r71759 - trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 7 08:46:36 EDT 2008


Author: newtonm
Date: 2008-04-07 08:46:36 -0400 (Mon, 07 Apr 2008)
New Revision: 71759

Modified:
   trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl
   trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight.xsl
   trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-eclipse.xsl
   trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-html.xsl
   trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-pdf.xsl
   trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/nochunk-html.xsl
   trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/xhtml-common.xsl
Log:
Made all section titles the same colour. Use graphical callouts instead of custom numbers. Increased callout number limit from 10 to 15. Changed code highlighting XSL to work on text nodes so that inlined callouts will render correctly. Turned off indenting as this incorrectly adds linebreaks to inline callout markup. Set PDF programlisting font back to verdana from monospaced.

Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl	2008-04-07 12:45:30 UTC (rev 71758)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight-pdf.xsl	2008-04-07 12:46:36 UTC (rev 71759)
@@ -10,17 +10,16 @@
                 version="1.0"
                 xmlns:jbh="java:org.jboss.highlight.renderer.FORenderer" 
                 exclude-result-prefixes="jbh">
-
+
   <xsl:template match="programlisting|programlisting[@role='XML']|programlisting[@role='JAVA']|programlisting[@role='XHTML']|programlisting[@role='JSP']|programlisting[@role='CSS']">
 		
     <xsl:variable name="role">
       <xsl:value-of select="s:toUpperCase(string(@role))" xmlns:s="java:java.lang.String"/>
     </xsl:variable>
-
-    <xsl:variable name="child.content">
-      <xsl:apply-templates/>
-    </xsl:variable>
-
+
+    <xsl:variable name="hilighter" select="jbh:new()"/>
+    <xsl:variable name="parsable" select="jbh:isParsable($role)"/>
+    
     <fo:block background-color="#F5F5F5"
               border-style="solid"
               border-width=".3mm"
@@ -37,21 +36,32 @@
               padding-right="12pt"
               padding-left="12pt">
 
-    <xsl:variable name="hilighter" select="jbh:new()"/>
-    <xsl:variable name="parsable" select="jbh:isParsable($role)"/>
-    
     <xsl:choose>
-      <xsl:when test="$parsable = 'true'">
-        <xsl:variable name="caller" select="jbh:parseText($hilighter, $role, string($child.content), 'UTF-8')"/>
-        <xsl:variable name="noOfTokens" select="jbh:getNoOfTokens($caller)"/>
+      <xsl:when test="$parsable = 'true'">
+        <xsl:for-each select="node()">
+          <xsl:choose>
+            <xsl:when test="self::text()">
+              <xsl:variable name="child.content" select="."/>
+      
+              <xsl:variable name="caller" select="jbh:parseText($hilighter, $role, string($child.content), 'UTF-8')"/>
+              <xsl:variable name="noOfTokens" select="jbh:getNoOfTokens($caller)"/>
 
-        <xsl:call-template name="iterator">
-          <xsl:with-param name="caller" select="$caller"/>
-          <xsl:with-param name="noOfTokens" select="$noOfTokens"/>
-        </xsl:call-template>
+              <xsl:call-template name="iterator">
+                <xsl:with-param name="caller" select="$caller"/>
+                <xsl:with-param name="noOfTokens" select="$noOfTokens"/>
+              </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+              <fo:inline>
+              <xsl:call-template name="anchor"/>
+              <xsl:apply-templates select="." mode="callout-bug"/>
+              </fo:inline>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:for-each>
       </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="$child.content"/>
+      <xsl:otherwise>
+        <xsl:apply-templates/>
       </xsl:otherwise>
     </xsl:choose>
 

Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight.xsl	2008-04-07 12:45:30 UTC (rev 71758)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/highlight.xsl	2008-04-07 12:46:36 UTC (rev 71759)
@@ -7,30 +7,63 @@
 -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version="1.0"
-                xmlns:rf="java:org.richfaces.highlight.XhtmlRendererFactory"
+                xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory"
                 exclude-result-prefixes="#default">
 
 	<xsl:template match="programlisting[@role='XML']|programlisting[@role='JAVA']|programlisting[@role='XHTML']|programlisting[@role='JSP']|programlisting[@role='CSS']">
 		
 		<xsl:variable name="role">
 			<xsl:value-of select="s:toUpperCase(string(@role))" xmlns:s="java:java.lang.String"/>
-		</xsl:variable>
-		<xsl:variable name="child.content">
-			<xsl:apply-templates/>
-		</xsl:variable>
+		</xsl:variable>
+		
 		<xsl:variable name="factory" select="rf:instance()"/>
 		<xsl:variable name="hiliter" select="rf:getRenderer($factory, string($role))"/>
-		<pre class="{$role}">	
-			<xsl:choose>
-				<xsl:when test="$hiliter">
-					<xsl:value-of select="jhr:highlight($hiliter, $role, string($child.content), 'UTF-8', true())"
-						xmlns:jhr="com.uwyn.jhighlight.renderer.Renderer" disable-output-escaping="yes"/>
-				</xsl:when>
-				<xsl:otherwise>
-					<xsl:copy-of select="$child.content"/>
-				</xsl:otherwise>
-			</xsl:choose>
-		</pre>
+
+		<pre class="{$role}">
+		<xsl:choose>
+		  <xsl:when test="$hiliter">
+            <xsl:for-each select="node()">
+              <xsl:choose>
+                <xsl:when test="self::text()">
+                  <xsl:variable name="child.content" select="."/>
+          
+          	      <xsl:value-of select="jhr:highlight($hiliter, $role, string($child.content), 'UTF-8', true())"
+						xmlns:jhr="com.uwyn.jhighlight.renderer.Renderer" disable-output-escaping="yes"/>
+			    </xsl:when>
+                <xsl:otherwise>
+                  <!-- Support a single linkend in HTML -->
+                  <xsl:variable name="targets" select="key('id', @linkends)"/>
+                  <xsl:variable name="target" select="$targets[1]"/>
+                  <xsl:choose>
+                  <xsl:when test="$target">
+                  <a>
+                    <xsl:if test="@id or @xml:id">
+                      <xsl:attribute name="id">
+                        <xsl:value-of select="(@id|@xml:id)[1]"/>
+                      </xsl:attribute>
+                    </xsl:if>
+                    <xsl:attribute name="href">
+                      <xsl:call-template name="href.target">
+                        <xsl:with-param name="object" select="$target"/>
+                      </xsl:call-template>
+                    </xsl:attribute>
+                    <xsl:apply-templates select="." mode="callout-bug"/>
+                  </a>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:call-template name="anchor"/>
+                    <xsl:apply-templates select="." mode="callout-bug"/>
+                  </xsl:otherwise>
+                  </xsl:choose>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:for-each>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </pre>
 		
 	</xsl:template>
                 

Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-eclipse.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-eclipse.xsl	2008-04-07 12:45:30 UTC (rev 71758)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-eclipse.xsl	2008-04-07 12:46:36 UTC (rev 71759)
@@ -23,10 +23,13 @@
 <xsl:include href="xhtml-common.xsl"/>
 <xsl:include href="highlight.xsl"/>
 
-<!-- This is needed to generate the correct xhtml-strict DOCTYPE on the front page -->
+<!-- This is needed to generate the correct xhtml-strict DOCTYPE on the front page.
+     We can't use indentation as the algorithm inserts linebreaks into the markup
+     created for callouts. This means that callouts appear on different lines than
+     the code they are supposed to refer to. -->
 <xsl:output method="xml"
             encoding="UTF-8"
-            indent="yes"
+            indent="no"
             doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
             standalone="no"/>

Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-html.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-html.xsl	2008-04-07 12:45:30 UTC (rev 71758)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-html.xsl	2008-04-07 12:46:36 UTC (rev 71759)
@@ -39,10 +39,13 @@
 <!-- Ignore image scaling in html version -->
 <xsl:param name="ignore.image.scaling" select="1"/> 
 
-<!-- This is needed to generate the correct xhtml-strict DOCTYPE on the front page -->
+<!-- This is needed to generate the correct xhtml-strict DOCTYPE on the front page.
+     We can't use indentation as the algorithm inserts linebreaks into the markup
+     created for callouts. This means that callouts appear on different lines than
+     the code they are supposed to refer to. -->
 <xsl:output method="xml"
             encoding="UTF-8"
-            indent="yes"
+            indent="no"
             doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
             standalone="no"/>

Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-pdf.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-pdf.xsl	2008-04-07 12:45:30 UTC (rev 71758)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/main-pdf.xsl	2008-04-07 12:46:36 UTC (rev 71759)
@@ -48,54 +48,140 @@
       Callouts
       ################################################### -->
 
-   <!-- We want to use callouts... -->
-   <xsl:param name="callout.extensions">1</xsl:param>
+   <!-- For backwards compatibility we want to use callouts specified using programlistingco elements -->
+   <xsl:param name="callouts.extension">1</xsl:param>
 
-   <!-- Place callout bullets at this column in programmlisting.-->
+   <!-- Place callout bullets at this column in programlisting.-->
    <xsl:param name="callout.defaultcolumn">80</xsl:param>
 
-   <!--
-      No, don't use crappy graphics for the callout bullets. This setting
-      enables some weird Unicode rendering for some fancy bullet points
-      in callouts. By default, this can only count to 10 and produces
-      strange results if you ever have more than 10 callouts for one
-      programlisting. We will fix that next.
-   -->
-   <xsl:param name="callout.graphics">0</xsl:param>
+   <!-- Use graphical callouts as they look nicer with highlighed code. -->
+   <xsl:param name="callout.graphics">1</xsl:param>
+   <xsl:param name="callout.graphics.number.limit">15</xsl:param>
+   <xsl:param name="callout.icon.size">10pt</xsl:param>
+   <xsl:param name="callout.graphics.extension">.png</xsl:param>
+   
+   <xsl:param name="callout.graphics.path">
+      <xsl:if test="$img.src.path != ''">
+         <xsl:value-of select="$img.src.path"/>
+      </xsl:if>
+      <xsl:text>images/callouts/</xsl:text>
+   </xsl:param>
 
-   <!--
-      Again, fun with DocBook XSL: The callout bullets are rendered in
-      two places: In the programlisting itself and in the list below
-      the listing, with the actual callout text. The rendering in the
-      programlisting is some XSL transformer extension (e.g. a Saxon
-      extension), so we can't change that without messing with the
-      extensions. We only can turn it off by setting this limit to
-      zero, then, a simple bracket style like "(3)" and "(4)" will
-      be used in the programlisting.
-   -->
-   <xsl:param name="callout.unicode.number.limit" select="'0'"></xsl:param>
+   <xsl:param name="programlisting.font" select="'verdana,helvetica,sans-serif'" />
+   <xsl:param name="programlisting.font.size" select="'100%'" />
 
-   <!--
-      The callout bullets in the actual callout list will be rendered
-      with an XSL FO template. The default template is broken: limited to 10
-      nice looking Unicode bullet points and then it doesn't print anything,
-      the fallback doesn't work. We implement our own template, which is not
-      as complicated, more ugly, but works. As always, function is more
-      important than form.
-   -->
-   <xsl:template name="callout-bug">
-      <xsl:param name="conum" select='1' />
-      <fo:inline color="black" padding-top="0.1em" padding-bottom="0.1em"
-         padding-start="0.2em" padding-end="0.2em" baseline-shift="0.1em"
-         font-family="{$monospace.font.family}" font-weight="bold"
-         font-size="75%">
-         <xsl:text>(</xsl:text>
-         <xsl:value-of select="$conum" />
-         <xsl:text>)</xsl:text>
+   <!-- Change to monospace font for programlisting, needed to workaround crappy callouts -->
+   <!-- <xsl:param name="programlisting.font" select="$monospace.font.family" /> -->
+
+   <!-- Make the font for programlisting slightly smaller -->
+   <!-- <xsl:param name="programlisting.font.size" select="'75%'" /> -->
+   
+<!-- 
+From: fo/callout.xsl
+Version: 1.73.2
+Reason: This includes the callout.icon.size attribute for SVGs, we also add padding to the graphics
+        (We can probably get rid of this if we upgrade to DocBook Stylesheets 1.73.2)
+ -->
+ <xsl:template name="callout-bug">
+  <xsl:param name="conum" select='1'/>
+
+  <xsl:choose>
+    <!-- Draw callouts as images -->
+    <xsl:when test="$callout.graphics != '0'
+                    and $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">
+        <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:when test="$callout.unicode != 0
+                    and $conum &lt;= $callout.unicode.number.limit">
+      <xsl:variable name="comarkup">
+        <xsl:choose>
+          <xsl:when test="$callout.unicode.start.character = 10102">
+            <xsl:choose>
+              <xsl:when test="$conum = 1">&#10102;</xsl:when>
+              <xsl:when test="$conum = 2">&#10103;</xsl:when>
+              <xsl:when test="$conum = 3">&#10104;</xsl:when>
+              <xsl:when test="$conum = 4">&#10105;</xsl:when>
+              <xsl:when test="$conum = 5">&#10106;</xsl:when>
+              <xsl:when test="$conum = 6">&#10107;</xsl:when>
+              <xsl:when test="$conum = 7">&#10108;</xsl:when>
+              <xsl:when test="$conum = 8">&#10109;</xsl:when>
+              <xsl:when test="$conum = 9">&#10110;</xsl:when>
+              <xsl:when test="$conum = 10">&#10111;</xsl:when>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:message>
+              <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
+              <xsl:text>when $callout.unicode.start.character is </xsl:text>
+              <xsl:value-of select="$callout.unicode.start.character"/>
+            </xsl:message>
+            <fo:inline background-color="#404040"
+                       color="white"
+                       padding-top="0.1em"
+                       padding-bottom="0.1em"
+                       padding-start="0.2em"
+                       padding-end="0.2em"
+                       baseline-shift="0.1em"
+                       font-family="{$body.fontset}"
+                       font-weight="bold"
+                       font-size="75%">
+              <xsl:value-of select="$conum"/>
+            </fo:inline>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <xsl:choose>
+        <xsl:when test="$callout.unicode.font != ''">
+          <fo:inline font-family="{$callout.unicode.font}">
+            <xsl:copy-of select="$comarkup"/>
+          </fo:inline>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:copy-of select="$comarkup"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+
+    <!-- Most safe: draw a dark gray square with a white number inside -->
+    <xsl:otherwise>
+      <fo:inline background-color="#404040"
+                 color="white"
+                 padding-top="0.1em"
+                 padding-bottom="0.1em"
+                 padding-start="0.2em"
+                 padding-end="0.2em"
+                 baseline-shift="0.1em"
+                 font-family="{$body.fontset}"
+                 font-weight="bold"
+                 font-size="75%">
+        <xsl:value-of select="$conum"/>
       </fo:inline>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>   
 
-   </xsl:template>
-
 <xsl:attribute-set name="xref.properties">
   <xsl:attribute name="font-style">italic</xsl:attribute>
   <xsl:attribute name="color">
@@ -298,11 +384,6 @@
    <!-- Include the chapter no -->
    <xsl:param name="section.label.includes.component.label" select="1" />
 
-
-<xsl:param name="callout.graphics.path">
-    <xsl:if test="$img.src.path != ''"><xsl:value-of select="$img.src.path"/></xsl:if><xsl:text>images/</xsl:text>
-</xsl:param>
-
 <!-- Format Variable Lists as Blocks (prevents horizontal overflow). -->
 <xsl:param name="variablelist.as.blocks">1</xsl:param>
 
@@ -360,46 +441,46 @@
 <xsl:param name="body.start.indent">0pt</xsl:param>
 
 <xsl:param name="title.color">#4a5d75</xsl:param>
-<xsl:param name="chaptertitle.color" select="$title.color" />
-<xsl:param name="section.level1.title.color" select="$title.color" />
+<xsl:param name="chapter.title.color" select="$title.color" />
+<xsl:param name="section.title.color" select="$title.color" />
 
 <xsl:attribute-set name="section.title.level1.properties">
-	<xsl:attribute name="color"><xsl:value-of select="$section.level1.title.color"/></xsl:attribute>
+	<xsl:attribute name="color"><xsl:value-of select="$section.title.color"/></xsl:attribute>
 	<xsl:attribute name="font-size">
 		<xsl:value-of select="$body.font.master * 1.6"/>
 		<xsl:text>pt</xsl:text>
 	</xsl:attribute>
 </xsl:attribute-set>
 <xsl:attribute-set name="section.title.level2.properties">
-	<xsl:attribute name="color"><xsl:value-of select="$title.color"/></xsl:attribute>
+	<xsl:attribute name="color"><xsl:value-of select="$section.title.color"/></xsl:attribute>
 	<xsl:attribute name="font-size">
 		<xsl:value-of select="$body.font.master * 1.4"/>
 		<xsl:text>pt</xsl:text>
 	</xsl:attribute>
 </xsl:attribute-set>
 <xsl:attribute-set name="section.title.level3.properties">
-	<xsl:attribute name="color"><xsl:value-of select="$title.color"/></xsl:attribute>
+	<xsl:attribute name="color"><xsl:value-of select="$section.title.color"/></xsl:attribute>
 	<xsl:attribute name="font-size">
 		<xsl:value-of select="$body.font.master * 1.3"/>
 		<xsl:text>pt</xsl:text>
 	</xsl:attribute>
 </xsl:attribute-set>
 <xsl:attribute-set name="section.title.level4.properties">
-	<xsl:attribute name="color"><xsl:value-of select="$title.color"/></xsl:attribute>
+	<xsl:attribute name="color"><xsl:value-of select="$section.title.color"/></xsl:attribute>
 	<xsl:attribute name="font-size">
 		<xsl:value-of select="$body.font.master * 1.2"/>
 		<xsl:text>pt</xsl:text>
 	</xsl:attribute>
 </xsl:attribute-set>
 <xsl:attribute-set name="section.title.level5.properties">
-	<xsl:attribute name="color"><xsl:value-of select="$title.color"/></xsl:attribute>
+	<xsl:attribute name="color"><xsl:value-of select="$section.title.color"/></xsl:attribute>
 	<xsl:attribute name="font-size">
 		<xsl:value-of select="$body.font.master * 1.1"/>
 		<xsl:text>pt</xsl:text>
 	</xsl:attribute>
 </xsl:attribute-set>
 <xsl:attribute-set name="section.title.level6.properties">
-	<xsl:attribute name="color"><xsl:value-of select="$title.color"/></xsl:attribute>
+	<xsl:attribute name="color"><xsl:value-of select="$section.title.color"/></xsl:attribute>
 	<xsl:attribute name="font-size">
 		<xsl:value-of select="$body.font.master"/>
 		<xsl:text>pt</xsl:text>
@@ -453,7 +534,7 @@
 </xsl:attribute-set>
 
 <xsl:attribute-set name="chapter.titlepage.recto.style">
-	<xsl:attribute name="color"><xsl:value-of select="$chaptertitle.color"/></xsl:attribute>
+	<xsl:attribute name="color"><xsl:value-of select="$chapter.title.color"/></xsl:attribute>
 	<xsl:attribute name="background-color">white</xsl:attribute>
 	<xsl:attribute name="font-size">
 		<xsl:choose>
@@ -1437,15 +1518,6 @@
   </fo:list-item>
 </xsl:template>
 
-<!-- <xsl:param name="programlisting.font" select="'verdana,helvetica,sans-serif'" />
-<xsl:param name="programlisting.font.size" select="'100%'" /> -->
-
-   <!-- Change to monospace font for programlisting, needed to workaround crappy callouts -->
-   <xsl:param name="programlisting.font" select="$monospace.font.family" />
-
-   <!-- Make the font for programlisting slightly smaller -->
-   <xsl:param name="programlisting.font.size" select="'75%'" />
-
    <!-- Now, set enable scalefit for large images -->
    <xsl:param name="graphicsize.extension" select="'1'" />
 

Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/nochunk-html.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/nochunk-html.xsl	2008-04-07 12:45:30 UTC (rev 71758)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/nochunk-html.xsl	2008-04-07 12:46:36 UTC (rev 71759)
@@ -27,10 +27,13 @@
 <!-- Ignore image scaling in html version -->
 <xsl:param name="ignore.image.scaling" select="1"/> 
 
-<!-- This is needed to generate the correct xhtml-strict DOCTYPE on the page -->
+<!-- This is needed to generate the correct xhtml-strict DOCTYPE on the front page.
+     We can't use indentation as the algorithm inserts linebreaks into the markup
+     created for callouts. This means that callouts appear on different lines than
+     the code they are supposed to refer to. -->
 <xsl:output method="xml"
             encoding="UTF-8"
-            indent="yes"
+            indent="no"
             doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
             standalone="no"/>

Modified: trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/xhtml-common.xsl
===================================================================
--- trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/xhtml-common.xsl	2008-04-07 12:45:30 UTC (rev 71758)
+++ trunk/docbook-support/jbossorg-docbook-xslt/src/main/resources/xslt/org/jboss/xhtml-common.xsl	2008-04-07 12:46:36 UTC (rev 71759)
@@ -21,7 +21,7 @@
    <xsl:param name="use.extensions">1</xsl:param>
 
    <!-- Enable callouts -->
-   <xsl:param name="callout.extensions">1</xsl:param>
+   <xsl:param name="callouts.extension">1</xsl:param>
 
    <!-- And disable these extensions -->
    <xsl:param name="tablecolumns.extension">0</xsl:param>
@@ -34,12 +34,20 @@
    
    <!-- Callouts -->
 
-   <!-- Don't use graphics, use a simple number style -->
-   <xsl:param name="callout.graphics">0</xsl:param>
+   <!-- Use graphics as they look better with highlighted code -->
+   <xsl:param name="callout.graphics">1</xsl:param>
+   <xsl:param name="callout.graphics.number.limit">15</xsl:param>
+   <xsl:param name="callout.icon.size">12px</xsl:param>
+   <xsl:param name="callout.graphics.extension">.png</xsl:param>
+   <xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
+   
+   <!-- Place callout marks at this column in annotated areas. The algorithm using this number doesn't
+        know about highlighted code with extra span elements so we need to pad each line at the start
+        with an XML comment and a line break. The callout marks must then be placed immediately afterwards.
+        This ensures that the callouts appear on the same line as the code it relates to and we can position
+        them using CSS so that they all appear in a column on the right. -->
+   <xsl:param name="callout.defaultcolumn">15</xsl:param>
 
-   <!-- Place callout marks at this column in annotated areas -->
-   <xsl:param name="callout.defaultcolumn">90</xsl:param>
-
       <xsl:template match="authorgroup" mode="titlepage.mode">
       <div class="authorgroup">
          <div class="authors">
@@ -69,20 +77,70 @@
 <xsl:param name="admon.graphics" select="1"/>
 <xsl:param name="admon.style" select="''"/>
 <xsl:param name="admon.graphics.path">images/</xsl:param>
-<xsl:param name="callout.graphics.path">images/</xsl:param>
 
 <xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD XHTML 1.0 Strict//EN'"/>
 <xsl:param name="chunker.output.doctype-system" select="'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'"/>
 <xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
-<xsl:param name="chunker.output.indent" select="'yes'"/>
 
+<!-- We must turn off indenting as the algorithm inserts linebreaks into the callout markup that is added by the
+     code highlighting routine. This causes the callouts to appear on different lines from the code they relate to. -->
+<xsl:param name="chunker.output.indent" select="'no'"/>
+
 <xsl:param name="html.stylesheet" select="'css/jbossorg.css'"/>
 <xsl:param name="html.stylesheet.type" select="'text/css'"/>
 <xsl:param name="html.cleanup" select="1"/>
 <xsl:param name="html.ext" select="'.html'"/>
-<xsl:output method="html" indent="yes"/>
+<!-- <xsl:output method="html" indent="no"/> -->
 
+<!-- 
+From: fo/callout.xsl
+Version: 1.73.2
+Reason: This includes the callout.icon.size attribute for SVGs
+        (We can probably get rid of this if we upgrade to DocBook Stylesheets 1.73.2)
+ -->
+ <xsl:template name="callout-bug">
+  <xsl:param name="conum" select="1"/>
 
+  <xsl:choose>
+    <xsl:when test="$callout.graphics != 0                     and $conum &lt;= $callout.graphics.number.limit">
+      <img src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}" alt="{$conum}" border="0" height="{$callout.icon.size}" width="{$callout.icon.size}"/>
+    </xsl:when>
+    <xsl:when test="$callout.unicode != 0                     and $conum &lt;= $callout.unicode.number.limit">
+      <xsl:choose>
+        <xsl:when test="$callout.unicode.start.character = 10102">
+          <xsl:choose>
+            <xsl:when test="$conum = 1">&#10102;</xsl:when>
+            <xsl:when test="$conum = 2">&#10103;</xsl:when>
+            <xsl:when test="$conum = 3">&#10104;</xsl:when>
+            <xsl:when test="$conum = 4">&#10105;</xsl:when>
+            <xsl:when test="$conum = 5">&#10106;</xsl:when>
+            <xsl:when test="$conum = 6">&#10107;</xsl:when>
+            <xsl:when test="$conum = 7">&#10108;</xsl:when>
+            <xsl:when test="$conum = 8">&#10109;</xsl:when>
+            <xsl:when test="$conum = 9">&#10110;</xsl:when>
+            <xsl:when test="$conum = 10">&#10111;</xsl:when>
+          </xsl:choose>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message>
+            <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
+            <xsl:text>when $callout.unicode.start.character is </xsl:text>
+            <xsl:value-of select="$callout.unicode.start.character"/>
+          </xsl:message>
+          <xsl:text>(</xsl:text>
+          <xsl:value-of select="$conum"/>
+          <xsl:text>)</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:text>(</xsl:text>
+      <xsl:value-of select="$conum"/>
+      <xsl:text>)</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <!-- TOC -->
 <xsl:param name="section.autolabel" select="1"/>
 <xsl:param name="section.label.includes.component.label" select="1"/>




More information about the jboss-cvs-commits mailing list