## 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. ## authored by Will Glass-Husain, wglass@apache.org ## note: this is entirely experimental. ## START THE PROCESSING #document() ## END THE PROCESSING ## ################################################################################################ #macro ( image $value )$value.getAttributeValue("src")#end ## ################################################################################################ #macro ( imageurl $value )$value#end ## ################################################################################################ ## implements simple hierarchal tables ## Doesn't really work right now #macro ( table $node ) #foreach ( $items in $node.Children)#if ($items.Name.equalsIgnoreCase("TR"))#tablerow($items)#end#end#end #macro (tablerow $node) #foreach ( $items in $node.getChildren())#if ($items.Name.equalsIgnoreCase("TD"))| #parsecontent($items.content)#elseif ($items.getName().equalsIgnoreCase("th"))| #parsecontent($items.content)#end#end#end ## ################################################################################################ #macro ( source $value) {{{$escape.getText($value.getText()) }}} #end ## ################################################################################################ #macro ( code $value) {{{$escape.getText($value.getText())}}} #end ## ################################################################################################ #macro ( subsection $subsection) === $subsection.getAttributeValue("name") === #parsecontent($subsection.getChildren()) #end ## ################################################################################################ #macro ( section $section) == $section.getAttributeValue("name") == #parsecontent($section.getChildren()) #end ## ################################################################################################ #macro ( paragraph $node) #parsecontent($node.content) #end ## ################################################################################################ #macro ( font $node)#parsecontent($node.content)#end ## ################################################################################################ #macro ( link $node)[$!node.getAttribute("href").Value$!node.getAttribute("HREF").Value $node.Text]#end ## ################################################################################################ #macro ( unorderedlist $node) #foreach ( $items in $node.getChildren()) #if ($items.getName().equalsIgnoreCase("LI"))* #parsecontent($items.content)#end#end#end ## ################################################################################################ #macro ( orderedlist $node) #foreach ( $items in $node.getChildren()) #if ($items.getName().equalsIgnoreCase("LI"))# #parsecontent($items.content)#end#end#end ## ################################################################################################ #macro (parsecontent $children)#foreach ( $items in $children )#if ($items.getName().equalsIgnoreCase("img"))#image ($items)#elseif ($items.getName().equalsIgnoreCase("code"))#code ($items) #elseif ($items.getName().equalsIgnoreCase("section"))#section ($items)#elseif ($items.getName().equalsIgnoreCase("subsection"))#subsection ($items)#elseif ($items.getName().equalsIgnoreCase("source"))#source ($items)#elseif ($items.getName().equalsIgnoreCase("table"))#table ($items)#elseif ($items.getName().equalsIgnoreCase("P"))#paragraph($items)#elseif ($items.getName().equalsIgnoreCase("UL"))#unorderedlist($items)#elseif ($items.getName().equalsIgnoreCase("OL"))#orderedlist($items)#elseif ($items.getName().equalsIgnoreCase("DIV"))#parsecontent($items.content)#elseif ($items.getName().equalsIgnoreCase("FONT"))#font($items)#elseif ($items.getName().equalsIgnoreCase("A"))#link($items)#elseif ($items.getName().equalsIgnoreCase("I"))#parsecontent($items.content)#elseif ($items.getName().equalsIgnoreCase("EM"))#parsecontent($items.content)#elseif ($items.content)#parsecontent($items.content)#else#**#$items.Text#end#end#end ## ################################################################################################ #macro (getProjectImage)#imageurl("http://jakarta.apache.org/images/jakarta-logo.gif")#end ## ################################################################################################ #macro (document) ## PAGE HEADER ## DOCUMENT BODY ## LOOP THROUGH ALL SECTIONS #set ($allSections = $root.getChild("body").getChildren("section"))#foreach ( $section in $allSections )#section ($section)#end ## PAGE FOOTER ## ---- #end