## 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.
#**
* Sets the $page_title key, so if it ever changes,
* it need only be changed here.
*#
#macro( title $string )
#set( $page_title = $string )#end
#**
* Creates a link to the javadoc for the specified tool.
*#
#macro( doclink $toolname $generic )
#set( $doclink =
"http://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/##
#if( $generic )generic/#else#**#view/#end##
${toolname}.html"
)##
$toolname#end
#**
* Creates a list item for the toolmenu.
*#
#macro( toolMenuItem $menulink $tool )
$text.tools.get($tool)
#end
#**
* Creates a smart default value for a demo field.
*#
#macro( demoDefault $valuetype )
#if( $valuetype.simpleName )
#set( $valuetype = $valuetype.simpleName )
#end
#if( $valuetype eq 'String' )
'test'##
#elseif( $valuetype eq 'int' or $valuetype eq 'Integer'
or $valuetype eq 'long' or $valuetype eq 'Long' )
1##
#elseif( $valuetype eq 'double' or $valuetype eq 'Double'
or $valuetype eq 'float' or $valuetype eq 'Float' )
1.1##
#elseif( $valuetype eq 'boolean' or $valuetype eq 'Boolean' )
true##
#elseif( $valuetype eq 'Class' )
${esc.d}class.class##
#end##
#end
#**
* Creates the start tag and header row for a function demonstration table.
*#
#macro( demoTableStart )
#set( $demo = $text.demo )
$demo.function |
$demo.description |
#end
#**
* Creates a demonstration row of a tool method that takes no parameters.
*#
#macro( demo $toolname $method $description )
${esc.d}${toolname}.${method} |
$render.eval("${esc.d}${toolname}.${method}") |
$description |
#end
#**
* Creates a faux demonstration row of a tool method that takes no parameters.
*#
#macro( demoAlt $toolname $method $result $description )
${esc.d}${toolname}.${method} |
$!result |
$description |
#end
#**
* Creates an interactive demonstration row for a tool method that takes one parameter.
*#
#macro( demo1 $toolname $method $size $description )
#if( !$quote )
#set( $quote = $esc.q )
#end
#end
#**
* Creates an interactive demonstration row for a tool method that takes two parameters.
*#
#macro( demo2 $toolname $method $size $description )
#if( !$quote )
#set( $quote = $esc.q )
#end
#set( $method1 = "${method}1" )
#set( $method2 = "${method}2" )
#end
#**
* Creates an interactive demonstration row for a tool method that takes three parameters.
*#
#macro( demo3 $toolname $method $size $description )
#if( !$quote )
#set( $quote = $esc.q )
#end
#set( $method1 = "${method}A" )
#set( $method2 = "${method}B" )
#set( $method3 = "${method}C" )
#end
#**
* Creates a free-form interactive demonstration row.
*#
#macro( demoCustom $toolname )
#end