[ANN] Amrita2 1.9.6

T

Taku Nakajima

------=_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.

<table border=3D'1'>
<tr><th>name</th><th>author</th></tr>
<tr id=3D'languages'>
<td><![CDATA[
<a href=3D'<%=3D $_.url %>'><%=3D $_.name %></a>
]]></td>
<td id=3D'creator'></td>
</tr>
</table>

CDATA in <td> 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.

<table border=3D'1'>
<tr><th>name</th><th>author</th></tr>
Ruby</a></td>
<td>matz</td>
perl</a></td>
<td>Larry Wall</td>
python</a></td>
<td>Guido van Rossum</td>
</tr>
</table>
 
G

Gavin Sinclair

Taku said:
Amrita2 is a XML/HTML template library for Ruby. I released a new
version 1.9.6 as BETA1 for 2.0.

Great. Any chance you could release Amrita as a gem?

Thanks,
Gavin
 
T

Taku Nakajima

Great. Any chance you could release Amrita as a gem?

I have uploaded gem of Amrita2 to rubyforge. So, you can install
Amrita2 by gem now. Just type

# gem install amrita2

I will upload gem of Amrita 1.0.X with next release of Amrita2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top