There is a nice assortment of template engines in Ruby. A good overview
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
a recent copy here (or search google for ruby html templates and
This site lists a quick snippet of their syntax and the major features
with links to the sites.