diff --git a/proposal/xdocs/build.xml b/proposal/xdocs/build.xml index fde72f543..a1f2101ad 100644 --- a/proposal/xdocs/build.xml +++ b/proposal/xdocs/build.xml @@ -76,5 +76,9 @@ --> + + + + diff --git a/proposal/xdocs/dvsl/README.txt b/proposal/xdocs/dvsl/README.txt new file mode 100644 index 000000000..e86af1e00 --- /dev/null +++ b/proposal/xdocs/dvsl/README.txt @@ -0,0 +1,16 @@ +This directory contains support for generating HTML task documentation +from the XDoclet generated XML. DVSL +(http://jakarta.apache.org/velocity/dvsl/) is used for this purpose. It has +many of the benefits of XSLT but uses Velocity as its template language. + +This is in a subdirectory as it is effectively a sub-proposal demonstrating +one way the task XML can be transformed into HTML. + +Directions: +1. Generate the XML task docs by running the build.xml in the parent + directory. +2. Generate the HTML docs by running the build file in this directory. + The output is written to ../build/docs/manual. + +-Bill Burton + diff --git a/proposal/xdocs/dvsl/build.xml b/proposal/xdocs/dvsl/build.xml new file mode 100644 index 000000000..6d8c495d6 --- /dev/null +++ b/proposal/xdocs/dvsl/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/proposal/xdocs/dvsl/lib/dom4j-1.1.1.jar b/proposal/xdocs/dvsl/lib/dom4j-1.1.1.jar new file mode 100644 index 000000000..a3c1bf5c5 Binary files /dev/null and b/proposal/xdocs/dvsl/lib/dom4j-1.1.1.jar differ diff --git a/proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar b/proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar new file mode 100644 index 000000000..259402099 Binary files /dev/null and b/proposal/xdocs/dvsl/lib/velocity-dep-1.3-dev.jar differ diff --git a/proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar b/proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar new file mode 100644 index 000000000..2fcc8af7b Binary files /dev/null and b/proposal/xdocs/dvsl/lib/velocity-dvsl-0.42.jar differ diff --git a/proposal/xdocs/dvsl/task.dvsl b/proposal/xdocs/dvsl/task.dvsl new file mode 100644 index 000000000..94ebbc342 --- /dev/null +++ b/proposal/xdocs/dvsl/task.dvsl @@ -0,0 +1,396 @@ +#* + * DVSL Stylesheet to format the Ant Task documentation. + *# + +#set( $relative-path = "." ) +#if (false) +#set( $body-bg = '#ffffff' ) +#set( $body-fg = '#000000' ) +#set( $body-link = '#525D76' ) +##set( $banner-bg = '#EEEEEE') +#set( $banner-fg = '#000000') +#set( $sub-banner-bg = '#828DA6') +#set( $sub-banner-fg = '#ffffff') +##set( $table-th-bg = '#FFEEEE') +##set( $table-td-bg = '#FFEEEE') +##set( $source-color = '#CCFFFF') + +#set( $table-th-bg = '#EEEEEE') +#set( $table-td-bg = '#EEEEEE') +#set( $banner-bg = '#a0ddf0') +##set( $banner-bg = '#525D76') +##set( $table-th-bg = '#039acc') +##set( $table-td-bg = '#a0ddf0') +#set( $source-color = '#023264') +#end + +#set( $body-bg = '#ffffff' ) +#set( $body-fg = '#000000' ) +#set( $body-link = '#525D76' ) +#set( $banner-bg = '#525D76') +#set( $banner-fg = '#ffffff') +#set( $sub-banner-bg = '#828DA6') +#set( $sub-banner-fg = '#ffffff') +#set( $table-th-bg = '#cccccc') +#set( $table-td-bg = '#eeeeee') +#set( $source-color = '#023264') +#set( $source-font-size = '+0') + +## Double quote for convenience +#set ($qq = '"') + +## Macro to output argument if test evaluates to true +#macro(ifset $test $output) +#if ( $test )$output#end +#end + +#match( "task" ) + #set( $task_name = $attrib.name ) + ## Create task title with first letter in upper case + #set( $task_title = "$task_name.substring(0,1).toUpperCase()$task_name.substring(1)" ) + + + + $task_title Task + + + + + + + ## PAGE HEADER + + + + + ## HEADER SEPARATOR + + ## + + + + + + + + + + + + + + + + + +
+ + ## JAKARTA LOGO + + The Jakarta Project + + + #if( $project.logo ) + + #set( $alt = $project.logo ) + #set( $home = $project.attribute("href") ) + #set( $src = $project.logo.attribute( "href" ) ) + + ## PROJECT LOGO + + $alt + + #end + +
+ +
+
+ $context.applyTemplates("long-description") + $context.applyTemplates("structure/attributes") + $context.applyTemplates("structure/elements") +
+
+
+
+ Copyright © 2000-2002, Apache Software Foundation +
+
+ + + +#end + +#* + Macro to format a table heading cell +*# +#macro( th $text ) + + + $text + +#end + +#* + Macro to format a table body cell +*# +#macro( td $text ) + + + $text + + +#end + +#* + Macro to format a section banner +*# +#macro( section $anchor $name ) + + + + $name + +#end + +#* + Macro to format a subsection banner +*# +#macro( subsection $anchor $name ) + + + + $name + +#end + + +#* + Match long-description section +*# +#match( "long-description" ) + + + + #section($task_name "$task_title Task Description") + + + +
 
+ $node.value() +
+#end + +#* + Match structure/attributes section +*# +#match( "structure/attributes" ) + + + + #section("attributes" "Parameters") + + + +
 
+ + + #th("Attribute") + #th("Description") + #th("Type") + + $context.applyTemplates("*") +
+
+#end + +#* + Match structure/elements section +*# +#match( "structure/elements" ) + + + + #section("elements" "Parameters as nested elements") + + + +
 
+ $context.applyTemplates("*") +
+#end + +#match( "attribute" ) + + #td($attrib.name) + #td($node.description) + #td($attrib.type) + +#end + +#match( "element" ) + + #subsection($attrib.name $attrib.name) + +
+ $node.description +
+#end + + +#* + * Process a menu for the navigation bar + *# +#match( "menu" ) + +

+ $attrib.name +

+ + +#end + + +#* + * Process a menu item for the navigation bar + *# +#match( "item" ) +#if( $attrib.href.endsWith("$outputfilename") && !$attrib.href.startsWith("http")) + $attrib.name +#else +#if( $attrib.href.startsWith("http") ) + $attrib.name + #else + $attrib.name + #end +#end +#end + +#* + * process a documentation section + *# +#match( "section" ) + + + + + + + +
 
+ + #if ( $attrib.anchor ) + #set( $anchor = $attrib.anchor ) + #else + #set( $anchor = $attrib.name ) + #end + + $attrib.name +
+ $context.applyTemplates("*") +
+#end + +#match( "subsection" ) + + + + + +
+ + #if ( $attrib.anchor ) + #set( $anchor = $attrib.anchor ) + #else + #set( $anchor = $attrib.name ) + #end + + $attrib.name +
+ $context.applyTemplates("*") +
+#end + +#match( "source" ) +
+ + + + + + + + + + + + + + + + +
+ + + + + +
+ + +
$toolbox.htmlescape.getText( $node.value() )
+
+ +
+ + + + + +
+
+#end + + +#match("table") + +$context.applyTemplates("*") +
+#end + +#match("tr") + +$context.applyTemplates("*") + +#end + +#match( "td" ) + + + $node.copy( $node.children() ) + + +#end + +#match( "th" ) + + + $node.copy( $node.children()) + + +#end + +#match("*") +$node.copy() +#end + diff --git a/proposal/xdocs/templates/task_xdoc.template b/proposal/xdocs/templates/task_xdoc.template index 21b60cf54..27b6e5231 100644 --- a/proposal/xdocs/templates/task_xdoc.template +++ b/proposal/xdocs/templates/task_xdoc.template @@ -10,21 +10,25 @@ - - - - ]]> - - - - - - - ]]> - - + + + + + ]]> + + + + + + + + + ]]> + + +