class RDiscount
end
require ‘bluecloth’
rescue LoadError
BlueCloth = RDiscount
require ‘rdiscount’
begin
require statements with the following:
Inject RDiscount into your BlueCloth-using code by replacing your bluecloth
== Replacing BlueCloth
puts markdown.to_html
markdown = RDiscount.new(“Hello World!”)
require ‘rdiscount’
by BlueCloth:
RDiscount implements the basic protocol popularized by RedCloth and adopted
== Usage
the Discount processor available via a Ruby C Extension library.
and passes the Markdown 1.0 test suite. The RDiscount extension makes
language in C. It implements all of the language as described in
Discount is an implementation of John Gruber’s Markdown markup
def initialize(text, *extensions)
* :explicitlist - Don't merge adjacent list into a single list.
* :latex - Keep LaTeX inside $$ intact.
* :no_strikethrough - Disable strikethrough processing.
* :no_superscript - Disable superscript processing.
* :no_pseudo_protocols - Do not process pseudo-protocols.
* :safelink - Do not make links for unknown URL types.
* :autolink - Greedily urlify links.
* :strict - Disable superscript and relaxed emphasis processing.
* :no_tables - Do not output any tables.
* :no_links - Do not output any tags.
* :no_image - Do not output any
* :generate_toc - Enable Table Of Contents generation
* :footnotes - PHP markdown extra-style footnotes.
* :fold_lines - RedCloth compatible line folding (not used).
the source text.
* :filter_html - Do not output any raw HTML tags included in
* :filter_styles - Do not output tags.
* :smart - Enable SmartyPants processing.
supplied to set various processing options:
should be a string containing Markdown text. Additional arguments may be
Create a RDiscount Markdown processor. The +text+ argument
def initialize(text, *extensions) @text = text extensions.each { |e| send("#{e}=", true) } end