|
|||||||
Amrita is a a html/xhtml template library for Ruby. It makes html documents from a template and a model data.
Key feature
Amrita mixes a template and model data up to a html document naturally matching the id attribute of HTML element to model data.
template:
<table border="1">
<tr><th>name</th><th>author</th></tr>
<tr id="table1">
<td id="name"><td id="author">
</tr>
</table>
data:
data = {
:table1=>[
{ :name=>"Ruby", :author=>"matz" },
{ :name=>"perl", :author=>"Larry Wall" },
{ :name=>"python", :author=>"Guido van Rossum" },
]
}
template + data = output:
<table>
<tr>
<th>name</th>
<th>author</th>
</tr>
<tr>
<td>Ruby</td>
<td>matz</td>
</tr>
<tr>
<td>perl</td>
.......
Amrita is a l00% pure Ruby library. You can install it three ways.
$ make # make install
# ruby install.rb
Amrita is Copyright (c) 2002 Taku Nakajima. It is free software, and may be redistributed under the terms specified in the README file of the Ruby distribution.
If you want to use Amrita in other license form, I will give you a BSD-like special license for only specified person and specified purpose. Please mail me about it in JAPANESE for detail.
(It's difficult to take an appropriate trade-off and make a good interface)
| Author: | Taku Nakajima <tnakajima@brain-tokyo.jp> |
| Requires: | Ruby 1.6.7 or later strscan 0.6.5 or later |
| License: | Copyright (c) 2002 Taku Nakajima Released under Ruby's License |