Hello,

In attempting to use the the site.dvsl and site_printable.dvsl stylesheets
on a converted Ant User's Guide page, I found several issues for which
I've attached a patch for these files.  These fixes and enhancements are
generic in nature and not at all specific to Ant.

File: examples/velocitydocs/build.xml:
* Renamed toolbox attribute to toolboxfile to avoid a deprecation warning.

Files: src/stylesheet/site.dvsl and src/stylesheet/site_printable.dvsl:
* In site_printable.dvsl, renamed the $FontSizeCode variable to
$source-font-size for consistency with other variables.
* In site.dvsl, added $source-font-size and supporting <font> tag support.
* Added to the <section> element an optional "anchor" attribute.  For
instance:
    <section anchor="buildfile" name="Using Ant: Writing a Simple
Buildfile">
  translates to 
    <a name="buildfile">Using Ant: Writing a Simple Buildfile</a>
  If the anchor attribute isn't specified, the name attribute is used
instead thus keeping backward compatibility.
* Fixed colspan and rowspan support in the #match("td") and #match("th")
sections.  Now, the rowspan and colspan attributes are only output if a
value has been set.  This fixes some table formatting errors that showed
up in Mozilla 0.98 and IE 5.5.

With these changes, the existing documentation should format in the same
way it has previously.

-Bill
Index: jakarta-velocity-dvsl/examples/velocitydocs/build.xml
===================================================================
RCS file: /home/cvspublic/jakarta-velocity-dvsl/examples/velocitydocs/build.xml,v
retrieving revision 1.2
diff -u -w -u -r1.2 build.xml
--- jakarta-velocity-dvsl/examples/velocitydocs/build.xml       28 Dec 2001 00:20:46 
-0000      1.2
+++ jakarta-velocity-dvsl/examples/velocitydocs/build.xml       12 Feb 2002 21:20:31 
+-0000
@@ -47,7 +47,7 @@
            basedir="${docs.src}" 
            destdir="${docs.dest}/"
            extension=".html" 
-          toolbox="${docs.src}/toolbox.props"
+          toolboxfile="${docs.src}/toolbox.props"
            style="../../src/stylesheets/site.dvsl"
            excludes="**/project.xml"
            includes="**/*.xml" 
@@ -64,17 +64,14 @@
                style="site.xsl"
             excludes="empty.xml"
             includes="*.xml">
+
       <param name="relative-path" expression="."/>
 
        <classpath refid="classpath"/>
      
-
     </style>
 
  </target>
 </project>
-
-
-
 
 
Index: jakarta-velocity-dvsl/src/stylesheets/site.dvsl
===================================================================
RCS file: /home/cvspublic/jakarta-velocity-dvsl/src/stylesheets/site.dvsl,v
retrieving revision 1.2
diff -u -w -u -r1.2 site.dvsl
--- jakarta-velocity-dvsl/src/stylesheets/site.dvsl     11 Jan 2002 01:39:57 -0000     
 1.2
+++ jakarta-velocity-dvsl/src/stylesheets/site.dvsl     12 Feb 2002 21:20:31 -0000
@@ -12,6 +12,15 @@
 #set( $table-th-bg = '#039acc')
 #set( $table-td-bg = '#a0ddf0')
 #set( $source-color = '#023264')
+#set( $source-font-size = '0')
+
+## Double quote for convenience
+#set ($qq = '"')
+
+## Macro to output argument if test evaluates to true
+#macro(ifset $test $output)
+#if ( $test )$output#end
+#end
 
 #match( "document" )
 
@@ -131,7 +140,12 @@
 
       <tr><td bgcolor="$banner-bg">
           <font color="$banner-fg" face="arial,helvetica.sanserif">
-          <a name="$attrib.name">
+          #if ( $attrib.anchor )
+              #set( $anchor = $attrib.anchor )
+          #else
+              #set( $anchor = $attrib.name )
+          #end
+          <a name="$anchor">
           <strong>$attrib.name</strong></a></font>
       </td></tr>
 
@@ -148,7 +162,12 @@
       <!-- Subsection heading -->
       <tr><td bgcolor="$sub-banner-bg">
           <font color="$sub-banner-fg" face="arial,helvetica.sanserif">
-          <a name="$attrib.name">
+          #if ( $attrib.anchor )
+              #set( $anchor = $attrib.anchor )
+          #else
+              #set( $anchor = $attrib.name )
+          #end
+          <a name="$anchor">
           <strong>$attrib.name</strong></a></font>
       </td></tr>
       <!-- Subsection body -->
@@ -179,7 +198,7 @@
             <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" 
border="0"/>
           </td>
           <td bgcolor="#ffffff" height="1">
-          <pre>$toolbox.htmlescape.getText( $node.value() )</pre>
+          <font size="$source-font-size"><pre>$toolbox.htmlescape.getText( 
+$node.value() )</pre></font>
           </td>
           <td bgcolor="$source-color" width="1">
             <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" 
border="0"/>
@@ -215,11 +234,10 @@
 #end
 
 #match( "td" )
-
-#set ($colspan = $attrib.colspan)
-#set ($rowspan = $attrib.rowspan)
-
-<td bgcolor="$table-td-bg" colspan="$!colspan" rowspan="$!rowspan" valign="top" 
align="left">
+<td bgcolor="$table-td-bg" #*
+    *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
+    *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
+    *#valign="top" align="left">
     <font color="#000000" size="-1" face="arial,helvetica,sanserif">
        $node.copy( $node.children() )
     </font>
@@ -227,11 +245,10 @@
 #end
 
 #match( "th" )
-
-#set ($colspan = $attrib.colspan )
-#set ($rowspan = $attrib.rowspan )
-
-<td bgcolor="$table-th-bg" colspan="$!colspan" rowspan="$!rowspan" valign="top" 
align="left">
+<td bgcolor="$table-th-bg" #*
+    *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
+    *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
+    *#valign="top" align="left">
     <font color="#000000" size="-1" face="arial,helvetica,sanserif">
        $node.copy( $node.children())
     </font>
Index: jakarta-velocity-dvsl/src/stylesheets/site_printable.dvsl
===================================================================
RCS file: /home/cvspublic/jakarta-velocity-dvsl/src/stylesheets/site_printable.dvsl,v
retrieving revision 1.2
diff -u -w -u -r1.2 site_printable.dvsl
--- jakarta-velocity-dvsl/src/stylesheets/site_printable.dvsl   11 Feb 2002 11:18:12 
-0000      1.2
+++ jakarta-velocity-dvsl/src/stylesheets/site_printable.dvsl   12 Feb 2002 21:20:31 
+-0000
@@ -12,8 +12,15 @@
 #set( $table-th-bg = '#FFEEEE')

 #set( $table-td-bg = '#FFEEEE')

 #set( $source-color = '#CCFFFF')

+#set( $source-font-size = '-1')
 

-#set($fontSizeCode = '1')

+## Double quote for convenience
+#set ($qq = '"')
+
+## Macro to output argument if test evaluates to true
+#macro(ifset $test $output)
+#if ( $test )$output#end
+#end
 

 #match( "document" )

 

@@ -152,7 +159,12 @@
 

       <tr><td bgcolor="$banner-bg">

           <font color="$banner-fg" face="arial,helvetica.sanserif">

-          <a name="$attrib.name">

+          #if ( $attrib.anchor )
+              #set( $anchor = $attrib.anchor )
+          #else
+              #set( $anchor = $attrib.name )
+          #end
+          <a name="$anchor">
           <strong>$attrib.name</strong></a></font>

       </td></tr>

 

@@ -169,7 +181,12 @@
       <!-- Subsection heading -->

       <tr><td bgcolor="$sub-banner-bg">

           <font color="$sub-banner-fg" face="arial,helvetica.sanserif">

-          <a name="$attrib.name">

+          #if ( $attrib.anchor )
+              #set( $anchor = $attrib.anchor )
+          #else
+              #set( $anchor = $attrib.name )
+          #end
+          <a name="$anchor">
           <strong>$attrib.name</strong></a></font>

       </td></tr>

       <!-- Subsection body -->

@@ -194,7 +211,7 @@
         <tr>

           

           <td bgcolor="#ffffff" height="1">

-          <font size="$fontSizeCode"><pre>$toolbox.htmlescape.getText( $node.value() 
)</pre></font>

+          <font size="$source-font-size"><pre>$toolbox.htmlescape.getText( 
+$node.value() )</pre></font>
           </td>

           

         </tr>

@@ -224,11 +241,10 @@
 #end

 

 #match( "td" )

-

-#set ($colspan = $attrib.colspan)

-#set ($rowspan = $attrib.rowspan)

-

-<td bgcolor="$table-td-bg" colspan="$!colspan" rowspan="$!rowspan" valign="top" 
align="left">

+<td bgcolor="$table-td-bg" #*
+    *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
+    *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
+    *#valign="top" align="left">
     <font color="#000000" size="-1" face="arial,helvetica,sanserif">

        $node.copy( $node.children() )

     </font>

@@ -236,11 +252,10 @@
 #end

 

 #match( "th" )

-

-#set ($colspan = $attrib.colspan )

-#set ($rowspan = $attrib.rowspan )

-

-<td bgcolor="$table-th-bg" colspan="$!colspan" rowspan="$!rowspan" valign="top" 
align="left">

+<td bgcolor="$table-th-bg" #*
+    *##ifset($attrib.colspan "colspan=$qq$attrib.colspan$qq ")#*
+    *##ifset($attrib.rowspan "rowspan=$qq$attrib.rowspan$qq ")#*
+    *#valign="top" align="left">
     <font color="#000000" size="-1" face="arial,helvetica,sanserif">

        $node.copy( $node.children())

     </font>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to