Forum: Ruby Template Engine in Ruby (similar to TT2)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B68827118969348473bf3bb7cfaf4e6a?d=identicon&s=25 Ralf Robert Höppel (Guest)
on 2007-02-13 17:04
(Received via mailing list)
Hi all,

is there a template engine similar to Template Toolkit 2 (in Perl)
available for Ruby? It should be feature-rich, stand-alone, not
restricted to only generate HTML output.

I know there are solutions around (everybody writes his own, I suppose),
but it is difficult to get an overview on what is available.

Thanks ---
Ralf.
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-02-13 17:16
(Received via mailing list)
ERB is a general templating language.

http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/

Jason
7572157852143be53747b2d08784cb6f?d=identicon&s=25 Jeff Barczewski (Guest)
on 2007-02-13 18:05
(Received via mailing list)
On 2/13/07, Ralf Robert Höppel <ralfrobert@web.de> wrote:
>
Ralf,

There is a nice assortment of template engines in Ruby. A good overview
of
the more common ones is on this wiki page. Many of these can be used for
both html and non-html output and they mention that in their features.

http://www.rubygarden.org/ruby?HtmlTemplates

however the wiki appears to be not responding right now so google cache
has
a recent copy [here][1] (or search google for ruby html templates and
you'll
find it)

This site lists a quick snippet of their syntax and the major features
along
with links to the sites.

Jeff

[1]:
http://72.14.203.104/search?q=cache:4Utrub7qvyIJ:w...
852a62a28f1de229dc861ce903b07a60?d=identicon&s=25 Gavin Kistner (phrogz)
on 2007-02-13 18:50
(Received via mailing list)
On Feb 13, 9:03 am, Ralf Robert Höppel <ralfrob...@web.de> wrote:
> is there a template engine similar to Template Toolkit 2 (in Perl) available for Ruby? 
It should be feature-rich, stand-alone, not restricted to only generate HTML output.

I'm not familiar with Perl or TT2. However, I will say that ERB (that
comes with Ruby) sounds like a good match. I use it at work for both
HTML and C++ code generation.

Because it was so common for me to want to use an XML file to drive an
ERB template, I wrote a little script that loads a specified XML file
into REXML, and makes that available to an ERB template.

It's simple, but it's Ruby...how much more simplicity and power do you
need? ;)

I've uploaded documentation and code for it at
http://phrogz.net/AnarkSamples/RubyGen/
This topic is locked and can not be replied to.