Information
Class Index
![show/hide quicksearch [+]](assets/icon/find.png)
- Malt
- Malt::Engine
- Malt::Engine::Abstract
- Malt::Engine::BlueCloth
- Malt::Engine::Builder
- Malt::Engine::Erb
- Malt::Engine::Erector
- Malt::Engine::Erubis
- Malt::Engine::Haml
- Malt::Engine::Kramdown
- Malt::Engine::Less
- Malt::Engine::Liquid
- Malt::Engine::Markaby
- Malt::Engine::Mustache
- Malt::Engine::RDiscount
- Malt::Engine::RDoc
- Malt::Engine::Radius
- Malt::Engine::Radius::context;
- Malt::Engine::RagTag
- Malt::Engine::RedCloth
- Malt::Engine::Ruby
- Malt::Engine::Sass
- Malt::Engine::Tenjin
- Malt::Format
- Malt::Format::Abstract
- Malt::Format::AbstractTemplate
- Malt::Format::Builder
- Malt::Format::CSS
- Malt::Format::Erb
- Malt::Format::Erector
- Malt::Format::HTML
- Malt::Format::Haml
- Malt::Format::LESS
- Malt::Format::Latex
- Malt::Format::Liquid
- Malt::Format::Markaby
- Malt::Format::Markdown
- Malt::Format::Mustache
- Malt::Format::PDF
- Malt::Format::RBHTML
- Malt::Format::RDoc
- Malt::Format::RHTML
- Malt::Format::Radius
- Malt::Format::RagTag
- Malt::Format::Ruby
- Malt::Format::SCSS
- Malt::Format::Sass
- Malt::Format::Tenjin
- Malt::Format::Text
- Malt::Format::Textile
- Malt::Format::UnsupportedConversion
- Malt::Format::XML
- Malt::Format::YAML
- Malt::Kernel
- Malt::Machine
- Malt::Markup
- Malt::NoEngineError
- Malt::Template
- Hash
- OpenStruct
Method Index
![show/hide quicksearch [+]](assets/icon/find.png)
- Malt ::cli
- Malt::Engine::Abstract ::default
- Malt::Engine ::defaults
- Malt::Format::Abstract ::engine
- Malt ::engine?
- Malt::Format::Abstract ::extensions
- Malt ::file
- Malt ::format?
- Malt ::machine
- Malt::Format::UnsupportedConversion ::new
- Malt::Format::Abstract ::new
- Malt::Engine::Abstract ::new
- Malt::Machine ::new
- Malt ::open
- Malt::Engine ::register
- Malt::Format ::register
- Malt::Engine::Abstract ::register
- Malt::Format::Abstract ::register
- Malt::Engine ::registry
- Malt::Format ::registry
- Malt ::render
- Malt ::text
- Malt::Engine::Abstract ::type
- Malt::Format::Builder #builder
- Malt::Engine::Abstract #cache?
- Malt::Engine::Tenjin #compile
- Malt::Engine::Ruby #compile
- Malt::Engine::Abstract #compile
- Malt::Template #compile
- Malt::Engine::Erubis #compile
- Malt::Engine::Erb #compile
- Malt::Format::LESS #css
- Malt::Format::CSS #css
- Malt::Format::Sass #css
- Malt::Format::SCSS #css
- Malt::Format::Latex #default
- Malt::Format::CSS #default
- Malt::Format::SCSS #default
- Malt::Format::LESS #default
- Malt::Format::Sass #default
- Malt::Format::Abstract #default
- Malt::Format::Abstract #engine
- Malt::Machine #engine
- Malt::Machine #engine?
- Malt::Engine::Erb #engine_options
- Malt::Engine::Builder #engine_options
- Malt::Engine::Radius #engine_options
- Malt::Engine::Tenjin #engine_options
- Malt::Engine::Erector #engine_options
- Malt::Machine #engines
- Malt::Format::Erector #erector
- Malt::Machine #ext_to_type
- Malt::Kernel #ext_to_type
- Malt::Format::Abstract #extensions
- Malt::Machine #file
- Malt::Format::Abstract #file
- Malt::Machine #file_read
- Malt::Machine #file_type
- Malt::Engine::RDiscount #flags
- Malt::Machine #format?
- Malt::Machine #formats
- Malt::Format::YAML #h
- Malt::Format::Haml #haml
- Malt::Format::Textile #html
- Malt::Format::Erector #html
- Malt::Format::RHTML #html
- Malt::Format::Erb #html
- Malt::Format::HTML #html
- Malt::Format::Radius #html
- Malt::Format::Haml #html
- Malt::Format::RagTag #html
- Malt::Format::RDoc #html
- Malt::Format::YAML #html
- Malt::Format::Markdown #html
- Malt::Format::Markaby #html
- Malt::Format::RBHTML #html
- Malt::Format::Builder #html
- Malt::Format::Tenjin #html
- Malt::Engine::RDoc #html_engine
- Malt::Engine::Radius #initialize_engine
- Malt::Engine::BlueCloth #initialize_engine
- Malt::Engine::RDoc #initialize_engine
- Malt::Engine::RDiscount #initialize_engine
- Malt::Engine::Erector #initialize_engine
- Malt::Engine::RedCloth #initialize_engine
- Malt::Engine::Builder #initialize_engine
- Malt::Engine::Mustache #initialize_engine
- Malt::Engine::Ruby #initialize_engine
- Malt::Engine::Markaby #initialize_engine
- Malt::Format::Abstract #initialize_engine
- Malt::Engine::Sass #initialize_engine
- Malt::Engine::Liquid #initialize_engine
- Malt::Engine::Less #initialize_engine
- Malt::Engine::Kramdown #initialize_engine
- Malt::Engine::Tenjin #initialize_engine
- Malt::Engine::Erubis #initialize_engine
- Malt::Engine::Abstract #initialize_engine
- Malt::Engine::Haml #initialize_engine
- Malt::Engine::Erb #initialize_engine
- Malt::Engine::RagTag #initialize_engine
- Malt::Engine::Tenjin #intermediate
- Malt::Engine::RDiscount #intermediate
- Malt::Engine::Sass #intermediate
- Malt::Engine::BlueCloth #intermediate
- Malt::Engine::Erector #intermediate
- Malt::Engine::Erb #intermediate
- Malt::Engine::RedCloth #intermediate
- Malt::Engine::Erubis #intermediate
- Malt::Engine::Liquid #intermediate
- Malt::Engine::Less #intermediate
- Malt::Engine::RagTag #intermediate
- Malt::Engine::Haml #intermediate
- Malt::Engine::Kramdown #intermediate
- Malt::Format::Latex #latex
- Malt::Format::Markdown #latex
- Malt::Format::LESS #less
- Malt::Format::Liquid #liquid
- Malt::Engine::Abstract #make_binding
- Malt::Engine::Radius #make_context
- Malt::Engine::Radius #make_context_from_hash
- Malt::Engine::Radius #make_context_from_object
- Malt::Engine::Abstract #make_hash
- Malt::Engine::Abstract #make_object
- Malt::Kernel #make_ostruct
- Malt::Format::Markaby #markaby
- Malt::Format::Markdown #markdown
- Malt::Format::Markdown #md
- Malt::Format::UnsupportedConversion #message
- Malt::Format::Ruby #method_missing
- Malt::Format::AbstractTemplate #method_missing
- Malt::Format::Text #method_missing
- Malt::Format::Mustache #mustache
- Malt::Machine #open
- Malt::Format::Abstract #parse_type_and_data
- Malt::Format::Latex #pdf
- Malt::Format::PDF #pdf
- Malt::Format::RHTML #precompile
- Malt::Format::Erb #precompile
- Malt::Format::RBHTML #precompile
- Malt::Machine #priority
- Malt::Format::Radius #radius
- Malt::Format::RHTML #rb
- Malt::Format::Tenjin #rb
- Malt::Format::Erb #rb
- Malt::Format::RBHTML #rb
- Malt::Format::Ruby #rb
- Malt::Format::RDoc #rdoc
- Malt::Format::Abstract #refile
- Hash #rekey
- Malt::Engine::RagTag #render
- Malt::Engine::Kramdown #render
- Malt::Engine::Builder #render
- Malt::Engine::Less #render
- Malt::Engine::Abstract #render
- Malt::Engine::RedCloth #render
- Malt::Engine::Liquid #render
- Malt::Engine::Markaby #render
- Malt::Engine::Erb #render
- Malt::Format::AbstractTemplate #render
- Malt::Engine::Haml #render
- Malt::Engine::BlueCloth #render
- Malt::Engine::Mustache #render
- Malt::Engine::RDiscount #render
- Malt::Format::Abstract #render
- Malt::Engine::Radius #render
- Malt::Engine::Erubis #render
- Malt::Engine::Ruby #render
- Malt::Engine::Sass #render
- Malt::Engine::Erector #render
- Malt::Format::Ruby #render
- Malt::Engine::Tenjin #render
- Malt::Engine::RDoc #render
- Malt::Machine #render
- Malt::Format::Markaby #render_engine
- Malt::Format::Ruby #render_engine
- Malt::Format::XML #render_engine
- Malt::Format::Markdown #render_engine
- Malt::Format::Liquid #render_engine
- Malt::Format::SCSS #render_engine
- Malt::Format::Mustache #render_engine
- Malt::Format::Latex #render_engine
- Malt::Format::RagTag #render_engine
- Malt::Format::PDF #render_engine
- Malt::Format::LESS #render_engine
- Malt::Format::Textile #render_engine
- Malt::Format::Radius #render_engine
- Malt::Format::Sass #render_engine
- Malt::Format::Haml #render_engine
- Malt::Format::Builder #render_engine
- Malt::Format::RBHTML #render_engine
- Malt::Format::RHTML #render_engine
- Malt::Format::HTML #render_engine
- Malt::Format::Erector #render_engine
- Malt::Format::Tenjin #render_engine
- Malt::Format::RDoc #render_engine
- Malt::Format::CSS #render_engine
- Malt::Format::Erb #render_engine
- Malt::Format::Text #render_engine
- Malt::Engine::Markaby #render_html
- Malt::Engine::Haml #render_html
- Malt::Engine::Erector #render_html
- Malt::Engine::Builder #render_html
- Malt::Engine::Abstract #require_library
- Malt::Format::Ruby #ruby
- Malt::Engine::Erubis #safe
- Malt::Format::Sass #sass
- Malt::Format::SCSS #scss
- Malt::Format::Abstract #subtype
- Malt::Machine #text
- Malt::Format::Abstract #text
- Malt::Format::Textile #textile
- Malt::Format::Ruby #to
- Malt::Format::AbstractTemplate #to
- Malt::Format::Abstract #to
- Malt::Format::Builder #to_builder
- Malt::Format::CSS #to_css
- Malt::Format::SCSS #to_css
- Malt::Format::LESS #to_css
- Malt::Format::Sass #to_css
- Malt::Format::Abstract #to_default
- Malt::Format::Erector #to_erector
- Malt::Format::Haml #to_haml
- Hash #to_hash
- OpenStruct #to_hash
- Malt::Format::HTML #to_html
- Malt::Format::Builder #to_html
- Malt::Format::YAML #to_html
- Malt::Format::Markdown #to_html
- Malt::Format::RagTag #to_html
- Malt::Format::Radius #to_html
- Malt::Format::Markaby #to_html
- Malt::Format::RHTML #to_html
- Malt::Format::Textile #to_html
- Malt::Format::Haml #to_html
- Malt::Format::Erb #to_html
- Malt::Format::Erector #to_html
- Malt::Format::Tenjin #to_html
- Malt::Format::RDoc #to_html
- Malt::Format::RBHTML #to_html
- Malt::Format::Latex #to_latex
- Malt::Format::Markdown #to_latex
- Malt::Format::LESS #to_less
- Malt::Format::Liquid #to_liquid
- Malt::Format::Markaby #to_markaby
- Malt::Format::Markdown #to_markdown
- Malt::Format::Markdown #to_md
- Malt::Format::Mustache #to_mustache
- Malt::Format::Latex #to_pdf
- Malt::Format::PDF #to_pdf
- Malt::Format::Radius #to_radius
- Malt::Format::RHTML #to_rb
- Malt::Format::RBHTML #to_rb
- Malt::Format::Ruby #to_rb
- Malt::Format::Tenjin #to_rb
- Malt::Format::Erb #to_rb
- Malt::Format::RDoc #to_rdoc
- Malt::Format::Erb #to_ruby
- Malt::Format::RHTML #to_ruby
- Malt::Format::RBHTML #to_ruby
- Malt::Format::Tenjin #to_ruby
- Malt::Format::Ruby #to_ruby
- Malt::Format::Abstract #to_s
- Malt::Format::Sass #to_sass
- Malt::Format::SCSS #to_scss
- Malt::Format::Textile #to_textile
- Malt::Format::Textile #to_tt
- Malt::Format::Text #to_txt
- Malt::Format::RagTag #to_xml
- Malt::Format::XML #to_xml
- Malt::Format::YAML #to_yaml
- Malt::Format::YAML #to_yml
- Malt::Engine::Erubis #trim
- Malt::Format::Textile #tt
- Malt::Format::Text #txt
- Malt::Format::Abstract #type
- Malt::Format::RagTag #xml
- Malt::Format::XML #xml
- Malt::Format::YAML #yaml
- Malt::Format::YAML #yml
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 © 2010 Thomas Sawyer
This program is ditributed under the terms of the Apache 2.0 license.
See the LICENSE.txt file for details.