# McBean 0.3.0 released

**URL:** <https://www.ruby-forum.com/t/mcbean-0-3-0-released/187159>\
**Category:** Ruby\
**Created:** [April 18, 2010, 9:14pm UTC](https://www.ruby-forum.com/t/mcbean-0-3-0-released/187159 "2010-04-18T21:14:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![miked](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@miked](https://www.ruby-forum.com/u/miked)\
**Post date:** [April 18, 2010, 9:14pm UTC](https://www.ruby-forum.com/t/mcbean-0-3-0-released/187159/1 "2010-04-18T21:14:09Z")

</div>

mcbean version 0.3.0 has been released!

- [http://github.com/flavorjones/mcbean](http://github.com/flavorjones/mcbean)
- \<[http://mcbean.heroku.com/doc/index.html](http://mcbean.heroku.com/doc/index.html) (rdocs)\>
- \<[http://mcbean.heroku.com](http://mcbean.heroku.com) (live demo)\>

== 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="  
[The Sneetches and Other Stories - Wikipedia](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](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.
