From: why the lucky stiff Date: 2003-03-27T04:28:53+09:00 Subject: Re: When modruby/eruby isn't available On Wednesday 26 March 2003 12:09 pm, Phil Tomson wrote: > I'd like to generate some web pages on demand from some templates (HTML > with embedded Ruby code) or perhaps use some combination of templates and > YAML files. A few templating systems take YAML documents directly. Amrita. [http://www.brain-tokyo.jp/research/amrita/sources/sample/tour/amsyaml.ams] The XTemplate library. [http://xtemplate.sf.net/yaml.html] Any templating system that can take a Ruby Hash or data structure will allow YAML loading, though. require 'amrita/template' require 'yaml' include Amrita tmpl = TemplateFile.new( "template.html" ) data = YAML::load( File.open( "template.yml" ) ) tmpl.expand( STDOUT, data ) With PageTemplate: require 'PageTemplate' require 'yaml' template = PageTemplate.new() template.load( "/var/www/templates/template.txt" ) template['config'] = YAML::load( File.open( "/var/www/config.yml" ) ) print template.output You'll be fine without eruby and mod_ruby. _why