Mcbean 0.4.0 Released

mcbean version 0.4.0 has been released!

McBean can convert documents from one format to another. McBean
currently
supports:

  • HTML
  • Markdown (a subset)
  • Textile (a subset)
  • Creole (a subset)

with the help of Loofah, Nokogiri, RDiscount, RedCloth and Creole.

“You can’t teach a Sneetch.” – Sylvester McMonkey McBean

== Changes

0.4.0 (2010-09-30)

Features:

  • Support for Creole (a wiki format)

== Features

  • Transforms HTML into Markdown
  • Transforms HTML into Textile
  • Transforms HTML into Creole
  • Textile ↔ Markdown, Textile ↔ Creole, Creole ↔ Markdown (thanks
    to
    RDiscount, RedCloth and Creole)
  • Emitted HTML is sanitized (thanks to Loofah).
  • Fancy-pants command line utility, “mcbean”.

== Problems

  • Only supports a limited subset of Markdown, Textile and Creole.
    Patches
    welcome.

== Synopsis

=== Short version

To convert HTML into Markdown, for example:

McBean.fragment(html).to_markdown

Or get fancy and convert Textile into Markdown:

McBean.textile(textile).to_markdown

=== Longer version

Create a McBean from your string, using the appropriate constructor:

mcbean = McBean.fragment your_html_fragment
or
mcbean = McBean.document your_html_document
or
mcbean = McBean.markdown your_markdown
or
mcbean = McBean.textile your_textile
or
mcbean = McBean.creole your_creole

And then generate the desired markup format:

mcbean.to_html
mcbean.to_markdown
mcbean.to_textile
mcbean.to_creole

=== Command Line

Also, +mcbean+ provides a command-line utility installed into your gem
path:

$ mcbean --html="
The Sneetches and Other Stories - Wikipedia"
–to-markdown
$ mcbean --markdown=“treetop-1.4.2/doc/grammar_composition.markdown”
–to-textile

You can try out McBean at the live demo site: http://mcbean.heroku.com