W
why the lucky stiff
RedCloth 3 is out. You know? RedCloth? Perhaps you've heard of it.
Or perhaps you've used Textile, the simple text markup it parses. Okay,
well then: RedCloth turns Textile markup into HTML.
<http://www.whytheluckystiff.net/ruby/redcloth/>
But RedCloth's gaze has fallen upon new text formats to devour. The new
RedCloth 3 adds preliminary support for Markdown. This means that you
can intermingle Textile and Markdown together!
RedCloth 3 uses the API of yore:
RedCloth.new( "I *stole* an orange." ).to_html
=> "<p>I <strong>stole</strong> an orange.</p>"
But now you can apply processing rules in order of descending
precedence. By default, the Textile engine takes precedence. But, if
you want the Markdown engine to be applied first:
RedCloth.new( str ).to_html( :markdown, :textile )
Or, use only the Markdown engine:
RedCloth.new( str ).to_html( :markdown )
RedCloth also allows nesting elements through indentation. To include a
paragraph in a list item:
ToDo
====
# Add Markdown lists
Allow lists fronted by digits,
followed by a period
RedCloth now generates valid XHTML 1.0 Strict fragments. Stuff like
image borders and alignment of elements are done using CSS.
RedCloth also now allows you to add your own custom Textile block tags.
I'll divulge all the HOWTO later on my site.
RedCloth should also handle complete HTML documents with embedded
Textile. I know plenty of you have been asking for this.
Okay, yeah, you get the point: lots.
_why
Or perhaps you've used Textile, the simple text markup it parses. Okay,
well then: RedCloth turns Textile markup into HTML.
<http://www.whytheluckystiff.net/ruby/redcloth/>
But RedCloth's gaze has fallen upon new text formats to devour. The new
RedCloth 3 adds preliminary support for Markdown. This means that you
can intermingle Textile and Markdown together!
RedCloth 3 uses the API of yore:
RedCloth.new( "I *stole* an orange." ).to_html
=> "<p>I <strong>stole</strong> an orange.</p>"
But now you can apply processing rules in order of descending
precedence. By default, the Textile engine takes precedence. But, if
you want the Markdown engine to be applied first:
RedCloth.new( str ).to_html( :markdown, :textile )
Or, use only the Markdown engine:
RedCloth.new( str ).to_html( :markdown )
RedCloth also allows nesting elements through indentation. To include a
paragraph in a list item:
ToDo
====
# Add Markdown lists
Allow lists fronted by digits,
followed by a period
RedCloth now generates valid XHTML 1.0 Strict fragments. Stuff like
image borders and alignment of elements are done using CSS.
RedCloth also now allows you to add your own custom Textile block tags.
I'll divulge all the HOWTO later on my site.
RedCloth should also handle complete HTML documents with embedded
Textile. I know plenty of you have been asking for this.
Okay, yeah, you get the point: lots.
_why