GitXplorerGitXplorer
f

mcbean

public
14 stars
5 forks
4 issues

Commits

List of commits on branch master.
Unverified
4baa7d32811a922934e787e9c0ddb296f8f7c0f4

documenting creole and giving thanks where it's due.

fflavorjones committed 14 years ago
Unverified
d696cafe78aa0bc0b0cc86246dd75bdda58e3c62

supporing bold/strong/i/em/hr in creole

fflavorjones committed 14 years ago
Unverified
1912e0187660d87c66f8f0e9dbf7863dc4d6c58d

modifying creolization of lists to support moinmoin, which uses leading spaces.

fflavorjones committed 14 years ago
Unverified
f63ac6bfc430b473da4d05791f294638c6856230

handling newlines inside header tags (read: "removing newlines")

fflavorjones committed 14 years ago
Unverified
f415692e52e893445bf8fdb2284c46b5665351ca

added support for bare <code> and <tt> tags.

fflavorjones committed 14 years ago
Unverified
35dd54d177f93fe409902b5dc65af9c85011b066

ignoring Gemfile.lock since we don't deploy anything.

fflavorjones committed 14 years ago

README

The README file for this repository.

= McBean

== Description

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

== Features

  • Transforms HTML into Markdown, and Markdown into HTML (with help from RDiscount).
  • Transforms HTML into Textile, and Textile into HTML (with help from RedCloth).
  • Transforms HTML into Creole, and Creole into HTML (with help from Creole).
  • Textile <-> Markdown
  • Textile <-> Creole
  • Creole <-> Markdown
  • 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

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

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

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

=== Side Note: Fragments vs Documents

Generally speaking, if you expect to have a DOCTYPE and a single root &lt;html&gt; node, you have a document. If you don't expect to have a single root node, you have a fragment.

== Requirements

  • Loofah >= 0.4.7 (and thusly Nokogiri)
  • RDiscount >= 1.6.0
  • RedCloth >= 4.2.0
  • Creole >= 0.3.7

== Install

  • sudo gem install mcbean

== Shout Outs

Thanks to David Loren Parsons and Ryan Tomayko for RDiscount.

Thanks to Jason Garber for RedCloth.

Thanks to Lars Christensen and Daniel Mendler for Creole.

== License

(The MIT License)

Copyright (c) 2010 Mike Dalessio

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.