adammurdoch    2002/06/11 04:53:56

  Modified:    site/src/xdocs/stylesheets docs.vsl
  Removed:     site/src/xdocs/stylesheets templates.vm
  Log:
  - Can't figure out how to make anakia find templates.vm when generating
    the taskdocs, so axed it instead.
  - Reworked docs.vsl, to add new <escaped> tag.  Text content of this tag
    is copied directly into output, without any escaping.
  
  Revision  Changes    Path
  1.3       +240 -38   jakarta-ant-myrmidon/site/src/xdocs/stylesheets/docs.vsl
  
  Index: docs.vsl
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/site/src/xdocs/stylesheets/docs.vsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- docs.vsl  6 Jun 2002 12:48:02 -0000       1.2
  +++ docs.vsl  11 Jun 2002 11:53:55 -0000      1.3
  @@ -1,23 +1,76 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
   
  -<!-- Content Stylesheet for Site -->
  +<!-- This is a generated file.  Do not edit. -->
  +## start the processing
  +#document()
  +## end the processing
   
  -    ## Defined variables
  -    #set ($bodybg = "#ffffff")
  -    #set ($bodyfg = "#000000")
  -    #set ($bodylink = "#525D76")
  -    #set ($bannerbg = "#525D76")
  -    #set ($bannerfg = "#ffffff")
  -    #set ($subbannerbg = "#828DA6")
  -    #set ($subbannerfg = "#ffffff")
  -    #set ($tablethbg = "#039acc")
  -    #set ($tabletdbg = "#a0ddf0")
  +#macro (document)
  +  #header()
  +  #set ($allSections = $root.getChild("body").getChildren("section"))
  +  #foreach ( $section in $allSections )
  +    #section ($section)
  +  #end
  +  #footer()
  +#end
   
  -<!-- start the processing -->
  -#document()
  -<!-- end the processing -->
  +#macro (header)
  +  <html>
  +    <head>
  +      <style type="text/css">
  +        @import url("$relativePath/css/tigris.css");
  +        @import url("$relativePath/css/site.css");
  +      </style>
  +      <meta http-equiv="Content-Type" content="text/html; 
charset=iso-8859-1"/>
   
  -## This is where the common page macro's live
  +      #set ($authors = $root.getChild("properties").getChildren("author"))
  +      #foreach ( $au in $authors )
  +        #metaauthor ( $au.getText() $au.getAttributeValue("email") )
  +      #end
  +
  +      <title>$project.getChild("title").getText() - 
$root.getChild("properties").getChild("title").getText()</title>
  +    </head>
  +
  +    <body marginwidth="0" marginheight="0" class="composite">
  +
  +      <div id="banner">
  +        <table border="0" cellspacing="0" cellpadding="8" width="100%">
  +          <!-- TOP IMAGE -->
  +          <tr>
  +            <td>#getProjectImage()</td>
  +            <td><div align="right" valign="bottom"><b><font 
size="+3">$project.getChild("title").getText()</font></b></div></td>
  +          </tr>
  +        </table>
  +      </div>
  +
  +      <table border="0" cellspacing="0" cellpadding="8" width="100%" 
id="main">
  +        <tr valign="top">
  +          <!-- LEFT SIDE NAVIGATION -->
  +          <td id="leftcol" width="20%">
  +            <div id="navcolumn">
  +            #makeProject()
  +            </div>
  +          </td>
  +          <td><div id="bodycol"><div class="app">
  +#end
  +
  +#macro (footer)
  +          </div></div></td>
  +        </tr>
  +      </table>
  +
  +      <!-- FOOTER -->
  +      <div id="footer">
  +        <table border="0" cellspacing="0" cellpadding="4">
  +          <tr>
  +            <td>Copyright &#169; 2000-2002, Apache Software Foundation</td>
  +          </tr>
  +        </table>
  +      </div>
  +
  +    </body>
  +  </html>
  +#end
   
   #macro ( subsection $subsection)
     <div class="h4">
  @@ -28,15 +81,7 @@
       #end
       <h4><a name="$anchor">$subsection.getAttributeValue("name")</a></h4>
       #foreach ( $items in $subsection.getChildren() )
  -      #if ($items.getName().equals("img"))
  -        #image ($items)
  -      #elseif ($items.getName().equals("source"))
  -        #source ($items)
  -      #elseif ($items.getName().equals("table"))
  -        #table ($items)
  -      #else
  -        $xmlout.outputString($items)
  -      #end
  +      #copy($items)
       #end
     </div>
   #end
  @@ -50,26 +95,183 @@
       #end
       <h3><a name="$anchor">$section.getAttributeValue("name")</a></h3>
       #foreach ( $items in $section.getChildren() )
  -      #if ($items.getName().equals("img"))
  -        #image ($items)
  -      #elseif ($items.getName().equals("source"))
  -        #source ($items)
  -      #elseif ($items.getName().equals("table"))
  -        #table ($items)
  -      #elseif ($items.getName().equals("subsection"))
  +      #if ($items.getName().equals("subsection"))
           #subsection ($items)
         #else
  -        $xmlout.outputString($items)
  +        #copy($items)
         #end
       #end
     </div>
   #end
   
  -#macro (document)
  -  #header()
  -  #set ($allSections = $root.getChild("body").getChildren("section"))
  -  #foreach ( $section in $allSections )
  -    #section ($section)
  +#macro ( table $table)
  +  #set ($rowcount = 1)
  +  <table cellpadding="3" cellspacing="2" border="1" width="100%">
  +  #foreach ( $items in $table.getChildren() )
  +    #if ($items.getName().equals("tr"))
  +      #tr ($items)
  +    #end
  +  #end
  +  </table>
  +#end
  +
  +#macro ( tr $tr)
  +  #printRow ($rowcount)
  +  #set ($rowcount = $rowcount + 1)
  +  #foreach ( $items in $tr.getChildren() )
  +    #if ($items.getName().equals("td"))
  +      #td ($items)
  +    #elseif ($items.getName().equals("th"))
  +      #th ($items)
  +    #end
  +  #end
  +  </tr>
  +#end
  +
  +#macro (printRow $count)
  +  #if ($count % 2 > 0)
  +    <tr class="a">
  +  #else
  +    <tr class="b">
  +  #end
  +#end
  +
  +#macro ( td $value)
  +  <td
  +    #if ($value.getAttributeValue("colspan"))
  +      #set ($colspan = $value.getAttributeValue("colspan"))
  +      colspan="$!colspan"
  +    #end
  +    #if ($value.getAttributeValue("rowspan"))
  +      #set ($rowspan = $value.getAttributeValue("rowspan"))
  +      rowspan="$!rowspan"
  +    #end
  +  >
  +    #if ($value.getText().length() != 0 || $value.hasChildren())
  +      #copycontent($value)
  +    #else
  +      &nbsp;
  +    #end
  +  </td>
  +#end
  +
  +#macro ( th $value)
  +  <th
  +    #if ($value.getAttributeValue("colspan"))
  +       #set ($colspan = $value.getAttributeValue("colspan"))
  +       colspan="$!colspan"
  +    #end
  +    #if ($value.getAttributeValue("rowspan"))
  +      #set ($rowspan = $value.getAttributeValue("rowspan"))
  +      rowspan="$!rowspan"
  +    #end
  +  >
  +    #if ($value.getText().length() != 0 || $value.hasChildren())
  +      #copycontent($value)
  +    #else
  +      &nbsp;
  +    #end
  +  </th>
  +#end
  +
  +#macro ( projectanchor $name $value )
  +  #if ($value.startsWith("http://";))
  +    <a href="$value">$name</a>
  +  #elseif ($value.startsWith("/site"))
  +    <a href="http://jakarta.apache.org$value";>$name</a>
  +  #else
  +    <a href="$relativePath$value">$name</a>
  +  #end
  +#end
  +
  +#macro ( metaauthor $author $email )
  +  <meta name="author" value="$author">
  +  <meta name="email" value="$email">
  +#end
  +
  +#macro ( image $value )
  +  #if ($value.getAttributeValue("width"))
  +    #set ($width=$value.getAttributeValue("width"))
  +  #end
  +  #if ($value.getAttributeValue("height"))
  +    #set ($height=$value.getAttributeValue("height"))
  +  #end
  +  #if ($value.getAttributeValue("align"))
  +    #set ($align=$value.getAttributeValue("align"))
  +  #end
  +  <img src="$relativePath$value.getAttributeValue("src")"
  +       width="$!width" height="$!height" align="$!align">
  +#end
  +
  +#macro ( source $value)
  +  <div id="source">
  +    <pre>$escape.getText( $value.text.trim() )</pre>
  +  </div>
  +#end
  +
  +#macro ( makeProject )
  +  #set ($menus = $project.getChild("body").getChildren("menu"))
  +  #foreach ( $menu in $menus )
  +    <div>
  +      <strong>$menu.getAttributeValue("name")</strong>
  +      #foreach ( $item in $menu.getChildren() )
  +        #set ($name = $item.getAttributeValue("name"))
  +        <div><small>#projectanchor($name 
$item.getAttributeValue("href"))</small></div>
  +      #end
  +    </div>
  +  #end
  +#end
  +
  +#macro (getProjectImage)
  +  #if ($project.getChild("logo"))
  +    <td align="left">
  +    <a href="http://jakarta.apache.org";><img 
src="http://jakarta.apache.org/images/jakarta-logo.gif"; border="0"/></a>
  +    </td>
  +    <td align="right">
  +    #set ( $logoString = $project.getChild("logo").getAttributeValue("href") 
)
  +    #if ( $logoString.startsWith("/") )
  +      <a href="$project.getAttributeValue("href")"><img 
src="$relativePath$logoString" alt="$project.getChild("logo").getText()" 
border="0"/></a>
  +    #else
  +      <a href="$project.getAttributeValue("href")"><img 
src="$relativePath/$logoString" alt="$project.getChild("logo").getText()" 
border="0"/></a>
  +    #end
  +    </td>
  +  #else
  +    <td colspan="2">
  +    <a href="http://jakarta.apache.org";><img 
src="http://jakarta.apache.org/images/jakarta-logo.gif"; align="left" 
border="0"/></a>
  +    </td>
  +  #end
  +#end
  +
  +#macro (copy $element)
  +  #if ( $element.name == "img" )
  +    #image ($element)
  +  #elseif ( $element.name == "source" )
  +    #source ($element)
  +  #elseif ( $element.name == "table" )
  +    #table ($element)
  +  #elseif ( $element.name == "pre" )
  +    <pre>$element.content</pre>
  +  #elseif ( $element.name == "escaped" )
  +    $element.text
  +  #else
  +    <$element.name
  +    #foreach ( $attr in $element.attributes )
  +      $attr.name="$attr.value"
  +    #end
  +    >#copycontent($element)</$element.name>
  +  #end
  +#end
  +
  +#macro (copycontent $element)
  +  #if ( $element.children.size() > 0 )
  +    #foreach ( $child in $element.content )
  +      #if ( $child.class.name.endsWith( "Element" ) )
  +        #copy( $child )
  +      #else
  +        $escape.getText( $child )
  +      #end
  +    #end
  +  #else
  +    $element.content
     #end
  -  #footer()
   #end
  
  
  

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

Reply via email to