File: rdiscount.rb [rdiscount-1.6.8 Documentation]

Last Modified
  2014-12-09 07:25:37 -0800
Requires
  - rdiscount.so

## Description

Discount is an implementation of John Gruber’s Markdown markup language in C. It implements all of the language as described in Markdown Syntax and passes the Markdown 1.0 test suite. The RDiscount extension makes the Discount processor available via a Ruby C Extension library.

## Usage

RDiscount implements the basic protocol popularized by RedCloth and adopted by BlueCloth:

    require 'rdiscount'
    markdown = RDiscount.new("Hello World!")
    puts markdown.to_html

## Replacing BlueCloth

Inject RDiscount into your BlueCloth-using code by replacing your bluecloth require statements with the following:

    begin
      require 'rdiscount'
      BlueCloth = RDiscount
    rescue LoadError
      require 'bluecloth'
    end