You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Will Glass-Husain <wg...@forio.com> on 2003/07/03 00:54:09 UTC

new docs

Hi,

I threw a few short notes up onto the Velocity Wiki.  It's a neat idea.
Maybe we can take "how to" type emails and get them up there.  I threw my
notes on how to revise Velocity syntax onto Tim's VelocityArchitecture page:

http://nagoya.apache.org/wiki/apachewiki.cgi?VelocityArchitecture

I also wrote an Anakia style sheet which does an acceptable job of
translating xdoc format to Wiki (not perfect, though).  It's at:

http://nagoya.apache.org/wiki/apachewiki.cgi?AnakiaWikiStyleSheet

WILL

P.S.  By the way, Wiki is very sensitive to whitespace/carriage returns.
I'm now a big fan of adding better whitespace handling to Velocity.  Getting
rid of excess carriage returns made the Wiki stylesheet almost unreadable in
part!
_______________________________________
Forio Business Simulations
Will Glass-Husain

wglass@forio.com
www.forio.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: new docs

Posted by Ch...@dlr.de.
Will Glass-Husain wrote:
> Hi,
> 
> I threw a few short notes up onto the Velocity Wiki.  It's a neat idea.
> Maybe we can take "how to" type emails and get them up there.  I threw my
> notes on how to revise Velocity syntax onto Tim's VelocityArchitecture page:
> 
> http://nagoya.apache.org/wiki/apachewiki.cgi?VelocityArchitecture

Cool!

>
> I also wrote an Anakia style sheet which does an acceptable job of
> translating xdoc format to Wiki (not perfect, though).  It's at:
> 
> http://nagoya.apache.org/wiki/apachewiki.cgi?AnakiaWikiStyleSheet
> 
> WILL
> 
> P.S.  By the way, Wiki is very sensitive to whitespace/carriage returns.
> I'm now a big fan of adding better whitespace handling to Velocity.  Getting
> rid of excess carriage returns made the Wiki stylesheet almost unreadable in
> part!

+1

Note that with my proposal to whitespace handling, the below cascade
would not produce *any* whitespace. Only the desired whitespaces
within the called macros would show in the output - this is what I
meant in other threads on this subject by "what most people would
expect"!

It would be much nicer to avoid needing the extra empty line in many
of these macros and then just write straight ahead:

#macro( parsecontent $children )
   #foreach( $items in $children )
     #if( $items.getName().equalsIgnoreCase("img") )
       #image($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") )
       #text( "<I>#parsecontent($items.content)</I>" )
     #elseif( $items.getName().equalsIgnoreCase("EM") )
       #text( "<EM>#parsecontent($items.content)</EM>" )
     #elseif( $items.content )
       #parsecontent($items.content)
     #else
       #text( "$items.Text" )
     #end
   #end
#end

Also see that I added a #text macro call to the <I> and <EM> tag
handling, otherwise my proposed handling would have emitted the
verbatim leanding spaces. Using the string interpolation avoids
any extra space, which is prettyer than writing:
       ...
     #elseif( $items.getName().equalsIgnoreCase("I") )#*
       *##parsecontent($items.content)</I>##
     #elseif( $items.getName().equalsIgnoreCase("EM") )#*
       *#...

By adding a global variable $indent and prefixing the lines
apropiately, adding #set( $indent = "$indent " ) before
recursive calls, and #set( $indent = $indent.substring(2) )
after these, you would even obtain prefectly nested&beautiful
output!

> _______________________________________
> Forio Business Simulations
> Will Glass-Husain
> 
> wglass@forio.com
> www.forio.com

-- 
:) Christoph Reck


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


RE: new docs

Posted by Tim Colson <tc...@cisco.com>.
> I threw a few short notes up onto the Velocity Wiki.  
Cool. :-)

> Maybe we can take "how to" type emails and get them up there. 
Some colleagues and I have been using a wiki for a while, and it seems
to be a good place for a collaborative "whiteboard". 
I would hope that if the wiki grows some good info, then eventually
snapshots be taken for inclusion into the Velocity XDOCS. 

> I also wrote an Anakia style sheet which does an acceptable job of
> translating xdoc format to Wiki (not perfect, though).  It's at:
Neat. I've yet to play with Anakia... just recently got the handle on
DVSL. :-)

http://nagoya.apache.org/wiki/apachewiki.cgi?AnakiaWikiStyleSheet

I noticed on the Struts pages that they decided to prefix every Struts
related page with "Struts". The rationale was that it would be easy to
'round up' all the Struts pages with a search.

Perhaps a good practice for these pages too?

Timo


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org