Project

minimal

0.02
No commit activity in last 3 years
No release in over 3 years
Minimal templating engine inspired by Markaby & Erector and targeted at Rails 3.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.0.0
 Project Readme

Minimal::Template Build Status

Minimal::Template is an experimental, minimalistic templating engine inspired by [Markaby]:(http://github.com/markaby/markaby) & [Erector]:(http://erector.rubyforge.org) but much smaller (~55 loc) and targeted at Rails 3.

# views/foo/bar.rb
module Foo
  class Bar < Minimal::Template
    def to_html
      html do
        head
        body do
          h1 'plain'
          p  local
        end
      end
    end
  end
end

# somewhere else
view = ActionView::Base.new('path/to/your/views')
view.render(:file => 'foo/bar', :locals => { :local => 'local' })

# => '<html><head></head><body><h1>plain</h1><p>local</p></body></html>'</pre>