[ANN] Kwartz-ruby 2.0.0-beta2 - a language independed template system

K

kwatch

Hi,

I have released Kwartz-ruby 2.0.0-beta2.
http://www.kuwata-lab.com/kwartz/

If you are Rails user, you'll get like it.

* 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 beta1

- [enhance] Raw-code supported.
Raw-code enables you to write presentation logics in Ruby, PHP,
or Java.
See:

http://www.kuwata-lab.com/kwartz/users-guide.en.04.html#topics-rawcode
http://www.kuwata-lab.com/kwartz/reference.en.01.html#pl-rawcode

- [enhance] New directive 'praceholder' supported.
Placeholder directive replaces content of the element by other
element.
See:

http://www.kuwata-lab.com/kwartz/reference.en.02.html#directive-placeholder

http://www.kuwata-lab.com/kwartz/p-pattern.en.01.html#replace-cont-by-elem

- [enhance] New command-line option '-i file,file2,...' supported.
This option includes elements defined in other files.
See:

http://www.kuwata-lab.com/kwartz/reference.en.02.html#directive-placeholder

http://www.kuwata-lab.com/kwartz/p-pattern.en.01.html#replace-cont-by-elem


* 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


I hope you like it.
 
M

Martin DeMello

kwatch said:
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).

Could someone familiar with both post a comparison of Kwartz and
Amrita?

martin
 
K

kwatch

Martin said:
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 <dl><dt><dd> 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 <dl> list.

example.html
--------------------
<ul id="list">
<dt id="value:word">..word..</dt>
<dd id="value:desc">...description...</dd>
</ul>
--------------------

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
--------------------
<ul id="list">
<% for item in item_list do %>
<% word = item["word"] %>
<% desc = item["desc"] %>
<dt><%= word %></dt>
<dd><%= desc %></dd>
<% end %>
</ul>
--------------------


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
 
M

Michael Neumann

Alexander said:
i'm also very interested in the answer to this

*very* simple answer (I might be wrong): Amrita is Ruby-only, Kwartz is
multi-lingual. Of course Kwartz has additional features...

Regards,

Michael
 
M

Martin DeMello

kwatch said:
For example, amrita is not good at to handle <dl><dt><dd> list.
Kwartz can generate it very naturally without using dummy tags,
because it can iterate only content of element.

Very interesting. Looking forward to checking kwartz out.

martin
 
K

kwatch

Michael said:
*very* simple answer (I might be wrong): Amrita is Ruby-only, Kwartz is
multi-lingual. Of course Kwartz has additional features...

Yes.
Kwartz adopts an original language similar to JavaScript
to describe presentation logic.
This approach enables templates to be compiled into
multi programming language.
In addition, it is easy for web designers who doesn't know Ruby or PHP
but know JavaScript to write presentation logic by themselves.

You may want to describe presentation logic in Ruby directly.
Kwartz let you to do that.
See:
http://kuwata-lab.com/kwartz/users-guide.en.04.html#topics-rawcode
 
J

jc

Hi,

was just browsing the Kwartz README:
Kwartz-java are now being developed.

I'm curious as to why you took this approach (writing an maintaining a
separate version of Kwartz for each language) versus writing a common
library in C and creating bindings for each language?

jc
 
K

kwatch

jc said:
I'm curious as to why you took this approach (writing an maintaining a
separate version of Kwartz for each language) versus writing a common
library in C and creating bindings for each language?


Reason1. Ruby-C binding or PHP-C binding is too hard for me to
implement.

Reason2. Anybody who know Ruby/PHP can modify or extend kwartz easily.

Reason3. What I want to do is to write program in Ruby.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top