blob: e4b4b1938a94e97cd8c78021c184f543d5e8bf58 [file] [log] [blame]
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements. See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership. The ASF licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing,
## software distributed under the License is distributed on an
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
## KIND, either express or implied. See the License for the
## specific language governing permissions and limitations
## under the License.
## DVSL style sheet for velocity-tools project
##
##
## The style sheet looks for the following configuration parameters:
##
## $context.toolbox.basedir
## Its value is expected to be the path to the base directory of
## this documentation set. It can be used to reference other files,
## for example a menu file that is to be loaded.
##
## $context.toolbox.PrinterFriendlyVersion
## If its value is "yes", the generated page has no left-hand menu.
## This facilitates the printing of documentation.
##
## $context.toolbox.LinkToPrinterFriendlyVersion
## If its value is "yes", a link to a printer-friendly version of
## the same document is added to the end of the left-hand menu.
## The file name of the printer-frienly document is derived from the
## the name of the current template in the following way:
## filename.html becomes filename-printer.html
##
##
## Shown below is a configuration example of an ant task:
## <!-- create printer version of documentation -->
## <dvsl
## basedir="${docs.src}"
## destdir="${docs.dest}/"
## toolboxfile="${basedir}/../xdocs/toolbox.props"
## extension="-printer.html"
## style="${basedir}/../xdocs/site.dvsl"
## excludes="*menu.xml"
## includes="**/*.xml">
## <tool name="toolbox.string.PrinterFriendlyVersion" value="yes" />
## <tool name="toolbox.string.basedir" value="${basedir}" />
## </dvsl>
##
#set( $body-bg = '#ffffff' )
#set( $body-fg = '#000000' )
#set( $body-link = '#525D76' )
#set( $banner-bg = '#525D76')
#set( $banner-fg = '#ffffff')
#set( $sub-banner-bg = '#828DA6')
#set( $sub-banner-fg = '#ffffff')
#set( $table-th-bg = '#039acc')
#set( $table-td-bg = '#a0ddf0')
#set( $source-color = '#023264')
#match( "document" )
#set( $document = $node )
#if ($context.toolbox.basedir)
#set( $projectfile = "$context.toolbox.basedir/$node.properties.projectfile" )
#else
#set( $projectfile = $node.properties.projectfile )
#end
#set( $project = $node.selectSingleNode("document('$projectfile')/project" ) )
<html>
<head>
<title>$project.title - $node.properties.title</title>
#foreach( $n in $node.properties.selectNodes("author") )
<meta name="author" value="$n"/>
#if( $n.attribute('email') )
<meta name="email" value="$n.attribute('email')" />
#end
#end
</head>
<body bgcolor="$body-bg" text="$body-fg" link="$body-link"
alink="$body-link" vlink="$body-link">
<table border="0" width="100%" cellspacing="4">
## PAGE HEADER
<tr><td colspan="2">
## VELOCITY LOGO
<a href="http://velocity.apache.org/">
<img src="http://velocity.apache.org/images/velocity_project_wide.png"
align="left" alt="The Velocity Project" border="0"/>
</a>
#if( $project.logo )
#set( $alt = $project.logo )
#set( $home = $project.attribute("href") )
#set( $src = $project.logo.attribute( "href" ) )
## PROJECT LOGO
<a href="$home">
<img src="$src" align="right" alt="$alt" border="0"/>
</a>
#end
</td></tr>
## HEADER SEPARATOR
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<tr>
## LEFT SIDE NAVIGATION
#if ($context.toolbox.PrinterFriendlyVersion.equals("yes"))
<td>&nbsp;</td>
#else
<td width="20%" valign="top" nowrap="true">
$context.applyTemplates( $project, "body/toplink" )
$context.applyTemplates( $project, "body/uplink" )
$context.applyTemplates( $project, "body/menu" )
$context.applyTemplates( $project, "body/printerversion" )
</td>
#end
<!-- RIGHT SIDE MAIN BODY -->
<td colspan="1" valign="top" align="left">
$context.applyTemplates("body/section")
</td>
</tr>
<!-- FOOTER SEPARATOR -->
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<!-- PAGE FOOTER -->
<tr><td colspan="2">
<div align="center"><font color="$body-link" size="-1"><em>
Copyright &#169; 1999-2003, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</body>
</html>
#end
#*
* Process a menu for the navigation bar
*#
#match( "menu" )
<p>
#if ($attrib.href)
<a href="$attrib.href"><strong>$attrib.name</strong></a>
#else
<strong>$attrib.name</strong>
#end
</p>
<ul>
$context.applyTemplates()
</ul>
#end
#*
* Process a submenu for the navigation bar
*#
#match( "submenu" )
#if ($attrib.href)
<li><a href="$attrib.href">$attrib.name</a>
#else
<li>$attrib.name
#end
<ul>
$context.applyTemplates("item")
</ul>
</li>
#end
#*
* Process a menu item for the navigation bar
*#
#match( "item" )
#if ($attrib.href)
<li><a href="$attrib.href">$attrib.name</a></li>
#else
<li>$attrib.name</li>
#end
#end
#*
* Process a link to one layer above in the navigation hierarchy
*#
#match( "uplink" )
<p><strong><a href="$attrib.href">$attrib.name</a></strong></p>
#end
#*
* Insert a link to a printerfriendly version of the document
*#
#match( "printerversion" )
<p>
#if ($context.toolbox.LinkToPrinterFriendlyVersion.equals("yes"))
<strong><a href="$context.getAppValue('infilename').substring(0, $context.getAppValue('infilename').lastIndexOf("."))-printer.html">Printer-friendly Version</a></strong>
#end
</p>
#end
#*
* process a documentation section
*#
#match( "section" )
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="2" bgcolor="$banner-bg">
<font color="$banner-fg" face="arial,helvetica.sanserif">
<a name="$attrib.name">
<strong>$attrib.name</strong></a></font>
</td>
</tr>
<tr>
<td NOWRAP> &nbsp; &nbsp; &nbsp; &nbsp; </td>
<td>
$context.applyTemplates("*")
</td>
</tr>
</table>
#end
#*
* process a documentation subsection
*#
#match( "subsection" )
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="2" bgcolor="$sub-banner-bg">
<font color="$sub-banner-fg" face="arial,helvetica.sanserif">
<a name="$attrib.name">
<strong>$attrib.name</strong></a></font>
</td>
</tr>
<tr>
<td NOWRAP> &nbsp; &nbsp; &nbsp; &nbsp; </td>
<td>
$context.applyTemplates("*")
</td>
</tr>
</table>
#end
#*
* process a tool method documentation
*#
#match( "method" )
$context.applyTemplates("*")
<br clear="all">
#end
#*
* process a one line abstract of a method documentation
*#
#match( "abstract" )
<p>
$node.copy()
</p>
#end
#*
* process a method signature
*#
#match( "signature" )
<p>
<table width="100%"><tr><td bgcolor="EEEEEE">
<font size="+1"><code>
$node.copy()
</code></font>
</td></tr></table>
</p>
#end
#*
* process a list of method parameters
*#
#match( "parameters" )
<dl>
<dt><strong>Parameters</strong></dt>
<dd>
<dl>
$context.applyTemplates("*")
</dl>
</dd>
</dl>
#end
#*
* process an individual method parameters
*#
#match( "parameter" )
<dt>$attrib.name</dt>
<dd>
$node.copy()
</dd>
#end
#*
* process a 'returns' tag of a method documentation
*#
#match( "returns" )
<dl>
<dt><strong>Returns</strong></dt>
<dd>
$node.copy()
</dd>
</dl>
#end
#*
* process a 'see' tag of a method documentation
*#
#match( "see" )
<dl>
<dt><strong>See Also</strong></dt>
<dd>
$node.copy()
</dd>
</dl>
#end
#*
* process a 'description' tag of a method documentation
*#
#match( "description" )
$context.applyTemplates("*")
#end
#*
* process a 'toolinfo' block
*#
#match( "toolinfo" )
<table cellpadding="0" cellspacing="0">
<tr><td colspan="2"><strong>Class</strong></td></tr>
<tr><td>&nbsp;</td><td>$node.clazz.value()</td></tr>
<tr><td colspan="2"><strong>Name</strong></td></tr>
<tr><td>&nbsp;</td><td>$node.name.value() (this is the recommended name of the tool in
the Velocity context)</td></tr>
<tr><td colspan="2"><strong>Toolbox Configuration Example</strong></td></tr>
<tr><td>&nbsp;</td><td><pre>$node.copy($node.config-example.children())</pre></td></tr>
<tr><td colspan="2"><strong>Author(s)</strong></td></tr>
<tr>
<td>&nbsp;</td>
<td>#foreach($n in $node.selectNodes("author"))#if( $n.attribute('email') )<a href="mailto:$n.attribute('email')">$n</a>#else$n#end<br>#end</td>
</tr>
</table>
#end
#*
* process a 'methods' block. Generates a list of methods.
*#
#match( "methods" )
<dl>
<dt><strong>Method Overview</strong></dt>
<dd>
<table cellpadding="2" cellspacing="2" border="0">
#foreach ($s in $document.body.selectNodes("section") )
#if ($s.method)
<tr>
<td bgcolor="EEEEEE" nowrap>
<a href="#$s.method.attrib("name")">$s.method.attrib("name")</a></td>
<td bgcolor="EEEEEE">
$node.copy($s.method.abstract.children())
</td>
</tr>
#end
#end
</table>
</dd>
</dl>
#end
#*
* process a 'sourcecode' block.
*#
#match( "sourcecode" )
<table width="100%" cellpadding="1" cellspacing="0" border="0"><tr><td bgcolor="#000000">
<table width="100%" cellpadding="5" cellspacing="0" border="0"><tr><td bgcolor="#FFFFFF">
<pre>$node.copy()</pre>
</td></tr></table>
</td></tr></table>
#end
#*
* process a 'source' block.
*#
#match( "source" )
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
</tr>
<tr>
<td bgcolor="$source-color" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="#ffffff" height="1">
<pre>
$node.copy()
</pre></td>
<td bgcolor="$source-color" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
</tr>
<tr>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
<td bgcolor="$source-color" width="1" height="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/>
</td>
</tr>
</table>
</div>
#end
#match("table")
<table>
$context.applyTemplates("*")
</table>
#end
#match("tr")
<tr>
$context.applyTemplates("*")
</tr>
#end
#match( "td" )
<td bgcolor="$table-td-bg" colspan="$!attrib.colspan" rowspan="$!attrib.rowspan" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
$node.copy( $node.children() )
</font>
</td>
#end
#match( "th" )
<td bgcolor="$table-th-bg" colspan="$!attrib.colspan" rowspan="$!attrib.rowspan" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
$node.copy( $node.children())
</font>
</td>
#end
#match ( "vel" )
$node.value()
#end
#match("*")
$node.copy()
#end