Sha256: 3d3426b033ab3a5f9dbfca53c84dac51e38759775870147934d21417fc8f983c

Contents?: true

Size: 1.73 KB

Versions: 1

Compression:

Stored size: 1.73 KB

Contents

= Malt

* home: http://rubyworks.github.com/malt
* code: http://github.com/rubyworks/malt


== DESCRIPTION

Malt provides a factory framework for rendering a variety of template and
markup document formats. Malt has a very object-oriented design
utilizing separate engine adapter classes and format classes. This makes
Malt easy to maintain, debug and extend, and thus more robust. In fact,
Malt supports template caching and ERB compilation by default, which was
very easy to implement thanks to it's clean design.


== SYNOPSIS

=== Functional API

  Malt.render(:file=>'foo.erb', :to=>:html, :data=>data)

Where +data+ is a data source of some type. Malt will see
that the file is an ERB template and render it accordingly.

The output of this call will be the HTML String.

=== Object-oriented API

  Malt.file('foo.erb').to_html(data).to_s

Where +data+ is a data source of some type. Malt will see
that the file is an ERB template and render it accordingly.

To get the render text you simple need to provide the template
or markup type.

  Malt.text(text, :type=>:erb).to_html(data).to_s

Notice the #to_s. This is needed because #to_html returns an 
Malt::Format::HTML object.


== COMING SOON

Malt can also "multi-render".

  Malt.file('foo.rdoc.erb').to_html(data)   # ~> foo.html


== INSTALATION

To install with RubyGems simply open a console and type:

  $ gem install  

For a site install you will need Ruby Setup and the compressed
packages (tar.gz or zip usually). Uncompress the package
cd into it and run setup.rb, e.g.

  $ tar -xvzf malt-x.y.z.tgz
  $ cd malt-x.y.z.tgz
  $ sudo setup.rb


== COPYING

Copyright (c) 2010 Thomas Sawyer

This program is ditributed under the terms of the Apache 2.0 license.

See the LICENSE.txt file for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
malt-0.3.0 README.rdoc