Amrita Homepage
What is Amrita?
Amrita is a a html/xhtml template library for Ruby. It makes html documents from a template and a model data.

Amrita provides to join pure html document and model data.
Key Features
- The template for Amrita is a pure html/xhtml document without no special tag like <?...?> or <% .. %>.
- The template can be written by designers using almost any HTML editor.
- Need no change on Ruby code to change the view of dynamic part (not only static part) of the template.
- The model data may be standard Ruby data, Hash, Array, String... or an instance of a classes you made.
- The output is controlled by _data_ not by logic. So It's easy to write, test, debug code. (Good for eXtreamPrograming)
- HTML template can be compiled into Ruby code before execution with a little effort.
Example
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> .......
Licence
Amrita is Copyright © 2002 Taku Nakajima. It is free software, and may be redistributed under the terms specified in the README file of the Ruby distribution.