= 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

* The template for amrita2 is a pure html/xhtml document without no
  special tag like <?...?> or <% .. %>

* The template can be written by designers using almost any xhtml/xml
  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)

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



== Installation

(Under construction)

Copy all files in 'lib' directory to any of Ruby library path.

== Documents 

README:: this file
README_FOR_1.0_USERS:: guide for amrita 1.0 users.
docs/QuickStart::  Quick start guide
docs/Spec::   Using Template Spec
docs/Reverse:: Reverse Engineering ( Generate a Ruby code from XHTML document)
docs/rda.rb:: Script for RD Document(Also it is a sample of RDA: RD with Amrita2)

== Files

=== lib

lib contains library source coude

amrita2/core.rb:: Amrita2 core feature
amrita2/ext.rb::  Amrita2 extention feature
amrita2/template.rb:: Facede Object
amrita2/test.rb:: UnitTest Support
amrita2/rd.rb::   RDA(RD with Amrita2) processor

=== sample/hello

basic examples

step1.rb:: sample for QuickStart
step2.rb:: sample for QuickStart
step3.rb:: sample for QuickStart
hello.rb:: simple code with passive PO API
hello2.rb:: simple code with active PO API
list.rb:: list(array) expansion with passive PO API
list2.rb :: list(array) expansion with active PO API
conditional.rb :: conditional expansion with passive PO API
conditional2.rb :: conditional expansion with active PO API
table.rb :: table expansion with passive PO API
table2.rb :: table expansion with active PO API
table3.rb:: table expansion using template spec
struct.rb :: table expansion with both passive and active PO API
dl.rb :: <DL> list expansion 

=== sample/spec

=== sample/reverse

=== sample/benchmark

(Under construction)

benchmark code

=== sample/rails

Amrita2-Rails bridge and sample using it.

See sample/rails/README.txt for detail.

=== sample/table

(Under construction)

A table display library built upon Amrita2.

=== test

Unit tests.


== Credits


== License

Amrita2 is Copyright (c) 2005 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 Amrita2 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.

== ToDos and plans


= Other stuff

Author::   Taku Nakajima <tnakajima@brain-tokyo.jp>
Requires:: Ruby 1.8.2 or later
License::  Copyright (c) 2005 Taku Nakajima
           Released under Ruby's License
