kramdown is a free Ruby library that can be used for parsing a superset of Markdown. It is completely written in Ruby, supports standard Markdown (with some minor modifications) and various extensions that have been made popular by the PHP Markdown Extra package and Maruku.
It is probably the fastest pure-Ruby Markdown converter available (November 2009), being 5x faster than Maruku and about 10x faster than BlueFeather.
The kramdown syntax is based on Markdown, a very easy to write, easy to read markup for writing HTML documents in plain text. Since the basic Markdown syntax has some shortcomings, implementations (especially the PHP Markdown Extra package) have tried to overcome this shortcomings with additional syntax. kramdown supports all features of the original Markdown syntax (albeit with some minor corrections) as well as newer features implemented in the PHP Markdown Extra package and Maruku.
Usage:
The kramdown package provides two ways for using it:
* As a library
kramdown uses basically the same API as RedCloth, BlueCloth and Maruku:
require 'kramdown'
Kramdown::Document.new(text).to_html
The second parameter to the new call is an options hash for (de)activating certain features. For more information have a look at the API documentation.
* As an application
Together with the library files a binary called kramdown is shipped which can be used to convert text in kramdown syntax to HTML. It either reads from the files specified as the command line arguments or from the standard input. For example:
kramdown path/to/kramdown/doc/syntax.page
Product's homepage
Requirements:
· Ruby
What's New in This Release: [ read full changelog ]
2 minor changes:
· HTML attributes without values are now supported (fixes bug RF#29490 reported by Nat Welch)
· HTML attributes names are now always converted to lower case for consistency
5 bug fixes:
· Fixed Document#method_missing to accept snake_cased class name (patch by tomykaira)
· Fixed problem with missing REXML constant on older Ruby 1.8.6 version (reported by Dave Everitt)
· Fixed bug RF#29520: Valid inline math statement does not trigger math block anymore (reported by Gioele Barabucci)
· Fixed bug RF#29521: HTML math output is now always XHTML compatible (reported by Gioele Barabucci)
· Empty id attributes are now handled better by the HTML and kramdown converters (reported by Jörg Sommer)
1 documentation fix:
· Fixed invalid options statement in example on quick reference page (reported by Jörg Sommer)