## 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. #document() ## This is where the macro's live #macro ( table $table) #foreach ( $items in $table.getChildren() ) #if ($items.getName().equals("tr")) #tr ($items) #end #end
#end #macro ( tr $tr) #foreach ( $items in $tr.getChildren() ) #if ($items.getName().equals("td")) #td ($items) #elseif ($items.getName().equals("th")) #th ($items) #end #end #end #macro ( td $value) #if ($value.getAttributeValue("colspan")) #set ($colspan = $value.getAttributeValue("colspan")) #end #if ($value.getAttributeValue("rowspan")) #set ($rowspan = $value.getAttributeValue("rowspan")) #end #foreach ( $items in $value.getContent() ) #if($items.name) #display($items) #else $items.value #end #end #end #macro ( th $value) #if ($value.getAttributeValue("colspan")) #set ($colspan = $value.getAttributeValue("colspan")) #end #if ($value.getAttributeValue("rowspan")) #set ($rowspan = $value.getAttributeValue("rowspan")) #end #foreach ( $items in $value.getContent() ) #if($items.name) #display($items) #else $items.value #end #end #end #macro ( projectanchor $name $value ) #if ($value.startsWith("http://")) $name #elseif ($value.startsWith("https://")) $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.getText())
#end ## need these to catch special macros within lists #macro(list $node) <$node.getName()> #foreach ( $items in $node.getChildren() ) #listitem($items) #end #end #macro (listitem $node) <$node.getName()> ## use getContent instead of getChildren ## to include both text and nodes #foreach ( $items in $node.getContent() ) #if($items.name) #display($items) #else $items.value #end #end #end ## # displays a basic node, calling macros if appropriate #macro ( display $node ) #if ($node.getName().equals("img")) #image ($node) #elseif ($node.getName().equals("source")) #source ($node) #elseif ($node.getName().equals("table")) #table ($node) #elseif ($node.getName().equals("ul")) #list ($node) #elseif ($node.getName().equals("ol")) #list ($node) #else $node #end #end #macro ( section $section)

$section.getAttributeValue("name")

#foreach ( $items in $section.getChildren() ) #if ($items.getName().equals("subsection")) #subsection ($items) #else #display($items) #end #end
#end #macro ( subsection $subsection)

$subsection.getAttributeValue("name")

#foreach ( $items in $subsection.getChildren() ) #display($items) #end
#end #macro ( anchorName $section) #if ($section.getAttributeValue("href")) $section.getAttributeValue("href")## #else $section.getAttributeValue("name")## #end #end #macro ( makeProject ) #set ($menus = $project.getChild("body").getChildren("menu")) #foreach ( $menu in $menus ) #end #end #macro (getProjectImage)
#if ($project.getChild("logo"))
#set ( $logoString = $project.getChild("logo").getAttributeValue("href") ) #if ( $logoString.startsWith("/") ) $project.getChild( #else $project.getChild( #end
#end #end #macro (printMeta $metaElement) #end #macro (document) #set ($authors = $root.getChild("properties").getChildren("author")) #foreach ( $au in $authors ) #metaauthor ( $au.getText() $au.getAttributeValue("email") ) #end #set ($metas = $root.getChildren("meta")) ## Parse meta directives such as ## #foreach ($meta in $metas) #printMeta($meta) #end ## Support for tags. #if ($root.getChild("properties").getChild("base")) #set ($url = $root.getChild("properties").getChild("base").getAttributeValue("href")) #end $project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText() ## use a relative CSS for when the page is displayed locally (will overwrite ## previous CSS settings) ## use a table in order to force footer to end of page
#set ($allSections = $root.getChild("body").getChildren("section")) #foreach ( $section in $allSections ) #section ($section) #end
#end