Sha256: 203da42ebe591a9919ee319b1dc8364b56995fefb4ca5a6a05d9423285a77f70

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

== Textile

Malt supports Textile via RedCloth.

Lets say we have a Textile document called 'test.tt' containing ...

  h1. Example

  This is an example of Textile rendering.

We can redner the textile document via the universal render function.
Textile documents are recognized by the +.textile+ or +.tt+ extension.

  html = Malt.render(:file=>'tmp/test.tt')

  html.assert.include?('<h1>Example</h1>')

Malt supports Textile via either the RedCloth or the ___ backend.

Lets say we have an Textile document called 'test.tt' containing ...

  h1. Example

  This is an example of Textile rendering.

We can access the file via the +Malt.file+ method. Textile documents are
recognized by the +.textile+ or +.tt+ extension.

  tile = Malt.file('tmp/test.tt')

We can the convert the document to a Malt Html object via the #to_html method.

  html = tile.to_html

Notice that the output is an instance of Malt::Format::HTML.

  html.class.assert == Malt::Format::HTML

And that by calling #to_s we can get the rendered HTML document.

  html.to_s.assert.include?('<h1>Example</h1>')

Or we can convert the document directly to HTML via the #html method.

  out = tile.html

  out.assert.include?('<h1>Example</h1>')

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
malt-0.3.0 qed/03_formats/03_textile.rdoc
malt-0.2.0 qed/03_formats/03_textile.rdoc
malt-0.1.1 qed/03_formats/03_textile.rdoc