#macro (header) #set ($authors = $root.getChild("properties").getChildren("author")) #foreach ( $au in $authors ) #metaauthor ( $au.getText() $au.getAttributeValue("email") ) #end $project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()
#end #macro (footer)
#getAuthorList()
#end #macro ( subsection $subsection)
#if ( $subsection.getAttributeValue("anchor") ) #set ($anchor = $subsection.getAttributeValue("anchor")) #else #set ($anchor = $subsection.getAttributeValue("name")) #end

$subsection.getAttributeValue("name")

#foreach ( $items in $subsection.getChildren() ) #copy($items) #end
#end #macro (section $section)
#if ( $section.getAttributeValue("anchor") ) #set ($anchor = $section.getAttributeValue("anchor")) #else #set ($anchor = $section.getAttributeValue("name")) #end

$section.getAttributeValue("name")

#foreach ( $items in $section.getChildren() ) #if ($items.getName().equals("subsection")) #subsection ($items) #else #copy($items) #end #end
#end #macro ( table $table) #set ($rowcount = 1) #foreach ( $items in $table.getChildren() ) #if ($items.getName().equals("tr")) #tr ($items) #end #end
#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 #end #macro (printRow $count) #if ($count % 2 > 0) #else #end #end #macro ( td $value) #if ($value.getText().length() != 0 || $value.hasChildren()) #copycontent($value) #else   #end #end #macro ( th $value) #if ($value.getText().length() != 0 || $value.hasChildren()) #copycontent($value) #else   #end #end #macro ( anchor $name $value ) #if ($value.startsWith("http://")) $name #elseif ($value.startsWith("/site")) $name #elseif ( $value.startsWith("/") ) $name #else $name #end #end #macro ( metaauthor $author $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 #end #macro ( source $value)
$escape.getText( $value.text.trim() )
#end #macro ( makeProject ) #set ($menus = $project.getChild("body").getChildren("menu")) #foreach ( $menu in $menus )
$menu.getAttributeValue("name") #foreach ( $item in $menu.getChildren() ) #set ($name = $item.getAttributeValue("name"))
#anchor($name $item.getAttributeValue("href"))
#end
#end #end #macro (getProjectImage) #if ($project.getChild("logo")) #set ( $logoString = $project.getChild("logo").getAttributeValue("href") ) #if ( $logoString.startsWith("/") ) $project.getChild( #else $project.getChild( #end #else #end #end #macro (copy $element) #if ( $element.name == "a" ) #anchor ( $element.content $element.getAttributeValue( "href" ) ) #elseif ( $element.name == "img" ) #image ($element) #elseif ( $element.name == "source" ) #source ($element) #elseif ( $element.name == "table" ) #table ($element) #elseif ( $element.name == "pre" )
$element.content
#elseif ( $element.name == "escaped" ) $element.text #else <$element.name #foreach ( $attr in $element.attributes ) $attr.name="$attr.value" #end >#copycontent($element) #end #end #macro (getAuthorList)
#set ($authors = $root.getChild("properties").getChildren("author")) #foreach ( $au in $authors ) #if( $velocityCount == 1 )by #end #if( $velocityCount != 1 ),#end $au.getText() #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.getText() ) #end #end #else $element.content #end #end