From: Taku Nakajima Date: 2005-12-07T18:03:00+09:00 Subject: [ANN] Amrita2 1.9.6 ------=_Part_28839_5549044.1133946173167 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Amrita2 is a XML/HTML template library for Ruby. I released a new version 1.9.6 as BETA1 for 2.0. Get it from http://amrita2.rubyforge.org/ I reduced undocumented features and refactored much to prepare the comming stable release. And .. * added gemspec and make it Rails plugin * simplified the ERB processing feature * new feature for setting two attributes (like class=3D'odd' and class=3D'even') alternately Now Amrita2 template can contain ERB source in it.
nameauthor
'><%=3D $_.name %> ]]>
CDATA in element will be evaluated as many times as number of 'languages' data. And each item will be set to '$_' before ERB evaluating. See this page for detail. How to use Amrita2 with Ruby On Rails http://amrita2.rubyforge.org/Rails.html And this method setup Template to insert two attributes alternately. def languages_setup_template(template) tmpl =3D Amrita2::TemplateText.new(template) tmpl.use_erb(binding) tmpl.element_option[:languages] =3D { :mv_attr=3D> { :class=3D>%w(odd e= ven) } } tmpl end This template produces output like this.
nameauthor
>Ruby matz
>perl Larry Wall
>python Guido van Rossum
-- Taku Nakajima ------=_Part_28839_5549044.1133946173167--