McBean 0.3.0 released

mcbean version 0.3.0 has been released!

== Description

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

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

with the help of Loofah, Nokogiri, RDiscount and RedCloth. That means
you
can convert Textile into Markdown, and Markdown into Textile.

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

== Features

  • Transforms HTML into Markdown.
  • Transforms HTML into Textile.
  • Transforms Markdown into HTML (thanks to RDiscount).
  • Transforms Textile into HTML (thanks to RedCloth).
  • Not to be overly pedantic, but transforms Textile into Markdown, and
    Markdown into Textile. Booyah!
  • Emitted HTML is sanitized (thanks to Loofah).
  • Fancy-pants command line utility, “mcbean”.

== Problems

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

== Synopsis

Wrap your document (which can be either a String or an IO object):

mcbean = McBean.fragment(your_html_fragment)
mcbean = McBean.document(your_html_document)
mcbean = McBean.markdown(your_markdown)
mcbean = McBean.textile(your_textile)

And then generate the desired markup format:

mcbean.to_html
mcbean.to_markdown
mcbean.to_textile

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

$ mcbean --html="
http://en.wikipedia.org/wiki/The_Sneetches_and_Other_Stories"
–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

== Changes

0.3.0 (2010-04-18)

Features:

  • Support for Textile.
  • McBean#to_html now does the right thing when the instance is created
    via
    McBean.markdown or McBean.textile.
  • McBean#to_html now entity-escapes unsafe and invalid HTML tags (thanks
    to
    Loofah).

Deprecations:

  • McBean.new and .allocate are now private. You shouldn’t have been
    using
    them, anyway.
  • McBean#html and #markdown accessors have been dropped.

== Requirements

  • Loofah >= 0.4.7 (and thusly Nokogiri)
  • RDiscount >= 1.3.4
  • RedCloth >= 4.0.0

== Install

  • sudo gem install mcbean

== Shout Outs

Thanks to David Loren Parsons and Ryan T. for RDiscount.

Thanks to Jason G. for RedCloth.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs