RDiscount converts documents in Markdown syntax to HTML.
It uses the excellent Discount processor by David Loren Parsons for this purpose, and thereby inherits Discount’s numerous useful extensions to the Markdown language.
Discount is fast and supports many useful extensions to the original Markdown language:
![GitHub Favicon](https://github.com/favicon.ico =16x16)
→ Some of these extensions are not enabled by default. See usage instructions below to enable additional extensions.
gem install rdiscount
RDiscount implements the basic protocol popularized by RedCloth and adopted by BlueCloth:
require 'rdiscount' markdown = RDiscount.new("Hello World!") puts markdown.to_html
Additional extensions can be turned on when creating the RDiscount object:
markdown = RDiscount.new("Hello World!", :smart, :filter_html)
For a list of all possible extensions, see the instance attributes in the RDiscount class documentation.
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
In your site’s _config.yml
file, add the line:
markdown: rdiscount
To enable extensions, add the following section with the desired list of extensions:
rdiscount: extensions: - autolink # greedily urlify links - footnotes # footnotes - smart # typographic substitutions with SmartyPants
For a list of all possible extensions, see the instance attributes in the RDiscount class documentation.
All development is coordinated on the GitHub project page.
Please report bugs and feature requests on the issue tracker.