amrita2 - a xml/xhtml template library for Ruby

Summary

Amrita2 is a a xml/xhtml template library for Ruby. It makes html documents from a template and a model data.

Key feature

Amrita2 mixes a template and model data up to a html document naturally matching the +id+ attribute of XML 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>            
  .......

Download

Online Documents

sample source

License

Amrita2 is Copyright (c) 2005 Taku Nakajima <tnakajima@brain-tokyo.jp>. It is free software, and may be redistributed under the terms specified in the README file of the Ruby distribution.