Class | RDiscount |
In: |
lib/rdiscount.rb
|
Parent: | Object |
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.
RDiscount implements the basic protocol popularized by RedCloth and adopted by BlueCloth:
require 'rdiscount' markdown = RDiscount.new("Hello World!") puts markdown.to_html
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
VERSION | = | '1.3.5' |
filter_html | [RW] | Do not output any raw HTML included in the source text. |
filter_styles | [RW] | Do not output <style> tags included in the source text. |
fold_lines | [RW] | RedCloth compatible line folding — not used for Markdown but included for compatibility. |
generate_toc | [RW] | Enable Table Of Contents generation |
smart | [RW] | Set true to have smarty-like quote translation performed. |
text | [R] | Original Markdown formatted text. |
Create a RDiscount Markdown processor. The text argument should be a string containing Markdown text. Additional arguments may be supplied to set various processing options:
NOTE: The :filter_styles extension is not yet implemented.