Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: HTML-Template.r ?

From: peoyli:algonet:se at: 2-May-2001 10:39

> >Anyone working on a HTML::Template (Perl module) clone for REBOL ? > > I don't know if you are referring to something like this exactly, but > perhaps the following example could be useful to solve your problem. > The logic is quite simple: > 1. An HTML template with placeholders > 2. A set of replacement rules > 3. A cycle that replace the placeholders using the replacement rules > Hope it helps. > > -- Paolo Russo >
It is useful, but not as a HTML::Template replacement... The real strength of HTML::Template is loops <TMPL_LOOP NAME="a_loop">, which loops through a array of values, repeating the HTML code produced (useful for tables etc.) and conditional code <TMPL_IF.., <TMPL_ELSE.., <TMPL_UNLESS.., all of these can be nested within each other, and can be hidden in comments so HTML validators won't complain about unknown tags. <TMPL_VAR NAME="something"> is easy to implement using some replacement rules, but the rest requires some more parsing of the given template to find out what belongs to what.. /PeO