Welcome to the kramdown site

kramdown (sic, not Kramdown or KramDown, just kramdown) is a free GPL-licensed Ruby library 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 (February 2010), being about 4.5x faster than Maruku and about 10x faster than BlueFeather.

The latest version of kramdown is 0.5.0 and it was released on 2010-02-15.

Syntax

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.

For a complete description of the implemented syntax, have a look at the Syntax page.

Usage

The kramdown package provides two ways for using it:

  • As a library

    kramdown uses basically the same API as RedCloth, BlueCloth and Maruku:

    1 require 'kramdown'
    2 
    3 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
    

Tests

kramdown uses various test suites to verify the correct working of the parser and the HTML converter. For more information, have a look at the tests document.

Bugs, Forums, Mailing Lists

If you have found a bug, you should report it here. Also, there are forums and mailing lists available if you have any questions!

Author