## ## Content Stylesheet for Site ## ## Defined variables ## #set ($bodybg = "#ffffff") #set ($bodyfg = "#000000") #set ($bodylink = "#525D76") #set ($bannerbg = "#525D76") #set ($bannerfg = "#ffffff") #set ($subbannerbg = "#828DA6") #set ($subbannerfg = "#ffffff") #set ($tablethbg = "#039acc") #set ($tabletdbg = "#a0ddf0") #set ($tabletebg = "#ffffff") ## ## Start and end the processing ## #document() ## ## This is where the macros live ## #macro ( relativise $elem ) #if ($elem.getAttribute("href")) #set ($href = $elem.getAttributeValue("href")) #if ($href.startsWith("/")) #set ($elem = $elem.setAttribute("href", "$relativePath$href")) #end #end #if ($elem.getAttribute("src")) #set ($href = $elem.getAttributeValue("src")) #if ($href.startsWith("/")) #set ($elem = $elem.setAttribute("src", "$relativePath$href")) #end #end #end ## ## #macro ( color_cell $elem $color ) #if (! $elem.getAttributeValue("bgcolor")) #set ($elem = $elem.setAttribute("bgcolor", "$color")) #end #if (! ($elem.getText().length() != 0 || $elem.hasChildren()) ) ## we need content in order for the color to show up on Navigator ## #set ($elem = $elem.addContent( new org.jdom.CDATA(" ") )) #if ($color == $tabletebg) #set ($elem = $elem.setText(" ")) #else #set ($elem = $elem.setText(".")) #end #end #end ## ## #macro ( color_table $table ) #foreach ( $tw in $treeWalk.allElements($table) ) #if ($tw.getName().equals("td")) #color_cell ($tw $tabletdbg) #elseif ($tw.getName().equals("th")) #color_cell ($tw $tablethbg) #elseif ($tw.getName().equals("trh")) #color_cell ($tw $tablethbg) #set ($tw = $tw.setAttribute("align", "left")) #set ($tw = $tw.setName("th")) #elseif ($tw.getName().equals("te")) #color_cell ($tw $tabletebg) #set ($tw = $tw.setName("td")) #end #end #if (! $table.getAttributeValue("width")) #set ($table = $table.setAttribute("width", "100%")) #end $table #end ## ## #macro ( make_note $note)
$note
#end ## ## #macro ( metaauthor $author $email ) #end ## ## #macro ( source $value )
$escape.getText($value.getText())
#end ## ## #macro ( section $section $level ) #if ($section.getChild("title")) #set ($heading = $section.getChildText("title")) #elseif ($section.getAttributeValue("id")) #set ($heading = $section.getAttributeValue("id")) #else #set ($heading = "") #end #if ($level == 1) ##
#elseif ($level == 2)
#else
#end #if ($section.getAttributeValue("id")) $heading #else $heading #end
## First, walk the tree and relativise any absolute path URI references ##foreach ( $tw in $treeWalk.allElements($section) ) ##relativise ($tw) ##end ## Second, output the section-level children with transformers #foreach ( $items in $section.getChildren() ) #if ($items.getName().equals("source")) #source ($items) #elseif ($items.getName().equals("table")) #color_table ($items) #elseif ($items.getName().equals("note")) #make_note ($items.getContent()) #elseif ($items.getName().equals("section")) #set ($sublevel = $level + 1) #section ($items $sublevel) #elseif ($items.getName().equals("title")) ## we already handled this one #else $items #end #end

#end ## ## #macro ( makeProject ) #set ($menus = $project.selectNodes("body/menu")) #foreach ( $menu in $menus ) ##foreach ( $tw in $menu.selectNodes("//*") ) ##relativise ($tw) ##end #set ($title = $menu.getChild("title")) #if ($title.getAttributeValue("href"))

$menu.getChildText("title")

#else

$menu.getChildText("title")

#end #if ($menu.getChild("li")) #foreach ( $item in $menu.getChildren("li") ) $item #end #end #end #end ## ## #macro ( getProjectImage ) #if ($project.getChild("logo"))
The Apache Portable Runtime Project #set ( $logoString = $project.getChild("logo").getAttributeValue("href") ) #if ( $logoString.startsWith("/") ) $project.getChild( #else $project.getChild( #end
#else

The Apache Portable Runtime Project

## ##

Mirrored
## Worldwide

## #end #end ## ## #macro ( document ) #set ($authors = $root.getChild("properties").getChildren("author")) #foreach ( $au in $authors ) #metaauthor ( $au.getText() $au.getAttributeValue("email") ) #end $root.getChild("properties").getChild("title").getText() - $project.getChild("title").getText() #getProjectImage()
#makeProject() #set ($allSections = $root.getChild("body").getChildren("section")) #foreach ( $section in $allSections ) #section ($section 1) #end

Copyright © 2008-2021, The Apache Software Foundation
Apache Portable Runtime, Apache, and the Apache feather logo are trademarks of The Apache Software Foundation.
#end