[ANN] Kwartz-ruby 2.0.0-beta1 - a template system for Ruby, PHP, and Java

Discussion in 'Ruby' started by Makoto Kuwata, Feb 13, 2005.

  1. Hi all,

    I'm pleased to announce the release of Kwartz-ruby 2.0.0-beta1.
    This is the first beta release.
    http://www.kuwata-lab.com/kwartz/

    Kwartz reborned from scratch and specifications are many changed.


    * What's that?

    Kwartz is a template system which is available with multi
    programming language (PHP, Ruby and Java).
    It is the first template system that realized the concept of
    'Separation of Presentation Logic and Presentaion data' (SoPL/PD).
    And Kwartz-ruby is an implementation of Kwartz in Ruby.
    (There is a plan to develop implementations in PHP and Java.)

    It is available to separate the presentation layer from the
    main program with any template system. In addition, Kwartz
    enables you to separate the presentation logics (iteration and
    conditional branching) from the presentation data (HTML file).


    * Features:

    - Separates presentation logic from presentation data.
    - Runs very fast
    - Supports multiple programing languages (PHP/Ruby/Java)
    - Doesn't break HTML design at all
    - Handles any text file
    - Supports Auto-Sanitizing and Partial-Sanitizing


    * Changed from previous version

    - syntax of presentation logic is completely changed
    - enabled to manipulate attributes value from presentation logic
    - embeded expression pattern is changed from '#{...}#' to '@{...}@'
    - and more


    * Example:

    - Presentation Data (example.html)
    There is no iteration nor conditional branching
    in the presentation data file.
    --------------------
    <table>
    <tr id="mark:items">
    <td id="mark:item">foo</td>
    </tr>
    </table>
    --------------------

    - Presentation Logic (example.plogic)
    There is no HTML tags in the presentation logic file.
    --------------------
    // elment marked as "items"
    #items {
    // iterate the element
    plogic: {
    foreach (item in list) {
    @stag; // start tag
    @cont; // content
    @etag; // end tag
    }
    }
    }

    // elment marked as "item"
    #item {
    // print value of a variable 'item' instead of the content
    value: item;
    }
    --------------------

    - Compile
    Generate an output script for eRuby, PHP, and JSP
    from presentation data and presentation logic.
    --------------------
    $ kwartz -l eruby -p example.plogic example.html > example.rhtml
    $ kwartz -l php -p example.plogic example.html > example.php
    $ kwartz -l jstl11 -p example.plogic example.html > example.jsp
    --------------------

    - Output Script
    (eRuby)
    --------------------
    <table>
    <% for item in list do %>
    <tr>
    <td><%= item %></td>
    </tr>
    <% end %>
    </table>
    --------------------

    (PHP)
    --------------------
    <table>
    <?php foreach ($list as $item) { ?>
    <tr>
    <td><?php echo $item; ?></td>
    </tr>
    <?php } ?>
    </table>
    --------------------

    (JSTL11)
    --------------------
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    <table>
    <c:forEach var="item" items="${list}">
    <tr>
    <td><c:eek:ut value="${item}" escapeXml="false"/></td>
    </tr>
    </c:forEach>
    </table>
    --------------------

    The above examples shows:
    - Presentation data (= HTML file) doesn't contain any logics.
    - Presentation logic file doesn't contain any data.
    - These are separated from the main program.

    The command-line option '-e' escapes the HTML special chars
    with 'htmlspecialchars()' in PHP, 'CGI::escapeHTML()' in eRuby,
    and '<c:eek:ut/>' tag without 'escapeXml="false"' in JSTL.


    * Resources:

    - Web Page:
    http://www.kuwata-lab.com/kwartz/

    - Download:
    https://www.kuwata-lab.com/kwartz/download.html

    - Users Guide:
    http://www.kuwata-lab.com/kwartz/users-guide.en.html

    - Reference Manual:
    http://www.kuwata-lab.com/kwartz/reference.en.html

    - Presentation Pattern Catalog:
    http://www.kuwata-lab.com/kwartz/p-pattern.en.html


    Have a good Valentine's Day!

    --
    regards,
    kwa
    Makoto Kuwata, Feb 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    98
    Ruby Tuesday
    Feb 12, 2004
  2. Makoto Kuwata
    Replies:
    0
    Views:
    79
    Makoto Kuwata
    Apr 5, 2004
  3. Makoto Kuwata
    Replies:
    0
    Views:
    89
    Makoto Kuwata
    May 9, 2004
  4. kwatch
    Replies:
    8
    Views:
    91
    kwatch
    Feb 21, 2005
  5. kwatch
    Replies:
    0
    Views:
    87
    kwatch
    Mar 7, 2005
Loading...

Share This Page