Template library - specific needs

(Its Me) #1

I'm looking for a template library that will allow me to define text
templates (mostly html, at least initially) with embedded Ruby calls, with
some specific needs / preferences:

- Be valid (x)html even with the embedded Ruby
- Allow selected Ruby calls in the template to return full (nested) html
structures (perhaps by that call itself dynamically using another template)

Any Suggestions? A search on RAA listed lots of candidates and I'm not sure
where to start.

Thanks.

(Mikkel Bruun) #2

there are many template systems in ruby...
erb templates are kind of the defacto standard...try it

(Greg Millam) #3

I'm looking for a template library that will allow me to define text
templates (mostly html, at least initially) with embedded Ruby calls, with
some specific needs / preferences:

erb is the accepted way to do this.

Frankly, though, I'm of the group that thinks code and templates should
not mix. (It's why I joined PageTemplate - I liked it so much, I took up
the project)

- Be valid (x)html even with the embedded Ruby

Technically, you can *probably* do this with any templating system. How?
Just use comments.

<!--
  <% ruby code here %>
-->

I still stand by my statement that code doesn't belong in templates :D.

(And for the record: you can use either the comment-style above, or
HTML::Template syntax in PageTemplate)

- Allow selected Ruby calls in the template to return full (nested) html
structures (perhaps by that call itself dynamically using another template)

Most systems should have an include command.

···

On Sat, Sep 03, 2005 at 01:36:25AM +0900, itsme213 wrote:

Any Suggestions? A search on RAA listed lots of candidates and I'm not sure
where to start.

(Ara.T.Howard) #4

amrita supports all of this and also separates code from template - the
templates are actually totally valid html. i've used it for years and love
it.

cheers.

-a

···

On Sat, 3 Sep 2005, itsme213 wrote:

I'm looking for a template library that will allow me to define text
templates (mostly html, at least initially) with embedded Ruby calls, with
some specific needs / preferences:

- Be valid (x)html even with the embedded Ruby
- Allow selected Ruby calls in the template to return full (nested) html
structures (perhaps by that call itself dynamically using another template)

Any Suggestions? A search on RAA listed lots of candidates and I'm not sure
where to start.

Thanks.

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

(James Edward Gray II) #5

ERb fails the very first requirement of what the other person was looking for. :wink:

James Edward Gray II

···

On Sep 2, 2005, at 12:31 PM, Mikkel Bruun wrote:

there are many template systems in ruby...
erb templates are kind of the defacto standard...try it