Re: Kanarie Template System

new topic     » goto parent     » topic index » view thread      » older message » newer message

Tommy Carlier wrote:

> Juergen, the Kanarie Template System is ready, tested and fully
> documented.
> I've submitted it to the Euphoria-site, and you can download it from
> http://users.telenet.be/tommycarlier/eu

I've been looking for something like the Kanarie Template System for
a long time. I also wrote something like that myself, but that was
rather primitive, compared to Kanarie. Parsing code [especially parsing
code *reliably* smile] is not the simplest task for a layman.

Kanarie actually looks as flexible and powerful as I was hopeing! It has
even those great 'list' and 'conditionals' elements! Also, the
documentation is very clean, comprehensive and understandable.

Thank you very much!!!

Maybe I have a suggestion for improvement. This is one of the examples
from your documentation:

<html>
	<body>
	{language=en:} This is the English version.
	{:language=nl:} Dit is de Nederlandse versie.
	{:language=fr:} Ceci est la version Fran=E7aise. {:language}
	</body>
</html

If the text in each language would consist of, say, several hundred
lines, this wouldn't look nice any more, and then it would be rather
difficult to get the overview of the structure of the template.

As far as I understand, we also can use fields, which might be better in
case of long texts:

<html>
	<body>
	{language=en:}{text_en}
	{:language=nl:}{text_nl}
	{:language=fr:}{text_fr}{:language}
	</body>
</html


Now my new idea. smile
In the previous example, my program must "fill out" the fields {text_en},
{text_nl}, and {text_fr}. I think it would be nice and powerful, if
Kanarie would accept a file name, and then just 'includes' the content
of that file at that place. Then this example could look something like
this:

<html>
	<body>
	{language=en:}{include=en.txt}
	{:language=nl:}{include=nl.txt}
	{:language=fr:}{include=fr.txt}{:language}
	</body>
</html

If you like, you could even allow 'en.txt' etc. not only to be plain
text files, but also template files themselves!

Next step ...
Using the naming convention that I used for the files in the previous
example, it would be very cool IMHO, if we also could write something
like this, to achieve the same result:

<html>
	<body>
	{include={language}.txt}
	</body>
</html

What do you think? :o)

I will use Kanarie at least for generating HTML files, and as a
macro-system for Euphoria, for example in order to automatically
generate different code for different platforms (like in one of your
examples). I think also e.g. block comments in Eu code should be easy
to realize using Kanarie, shouldn't it?

Kanarie is very simple and powerful at the same time, and IMHO its
possibilities are mainly limited by the fantasy of its users. smile
Thanks very much again, Tommy!

Regards,
   Juergen


PS: I also thought of nested fields, but that probably makes things too
    complicated ...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu