Template Engine in Ruby (similar to TT2)

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.

ERB is a general templating language.

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

Jason

···

On 2/13/07, Ralf Robert Höppel <ralfrobert@web.de> wrote:

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.

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.

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:www.rubygarden.org/ruby%3FHtmlTemplates+ruby+html+template&hl=en&client=firefox-a&strip=1&lt;http://72.14.203.104/search?q=cache:4Utrub7qvyIJ:www.rubygarden.org/ruby%253FHtmlTemplates+ruby+html+template&hl=en&client=firefox-a&strip=1&gt;

···

On 2/13/07, Ralf Robert Höppel <ralfrobert@web.de> wrote:

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.

--
Jeff Barczewski, MasterView core team
Inspired Horizons Ruby on Rails Training and Consultancy
Next Ruby on Rails plus JRuby workshop Feb 22-24 St. Louis, MO
http://inspiredhorizons.com/training/rails/index.html

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? :wink:

I've uploaded documentation and code for it at
http://phrogz.net/AnarkSamples/RubyGen/

···

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.