From: kwatch Date: 2005-02-20T09:49:45+09:00 Subject: Re: [ANN] Kwartz-ruby 2.0.0-beta2 - a language independed template system Martin DeMello wrote: > Could someone familiar with both post a comparison of Kwartz and > Amrita? * Amrita and Kwartz doesn't break HTML design at all. * Kwartz can separate presentation logic from main program as well as from HTML file. In amrita, presentaion logic must be in main program. * Kwartz let you to describe complex presentation logic more naturally than amrita. * Kwartz supports auto-sanitizing. * ..and more. For example, amrita is not good at to handle
list. Kwartz can generate it very naturally without using dummy tags, because it can iterate only content of element. The following is an example of Kwartz to generate
list. example.html --------------------
    ..word..
    ...description...
-------------------- example.plogic -------------------- #list { plogic: { @stag; // start tag foreach (item in item_list) { // iterate only content word = item['word']; desc = item['desc']; @cont; // content } @etag; // end tag } } -------------------- compilation: -------------------- $ kwartz -p example.plogic example.html > example.rhtml -------------------- example.rhtml --------------------
    <% for item in item_list do %> <% word = item["word"] %> <% desc = item["desc"] %>
    <%= word %>
    <%= desc %>
    <% end %>
-------------------- If you have to use complex presentation logic, you will like Kwartz. See: Kwartz Users' Guide: http://www.kuwata-lab.com/kwartz/users-guide.en.html Presentation Pattern Catalog: http://www.kuwata-lab.com/kwartz/p-pattern.en.html -- regards, kwatch