Rails plugin Markdown

阅读更多
1. RDiscount

http://github.com/rtomayko/rdiscount

> sudo gem install rdiscount


Usage

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

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


Additional processing options can be turned on when creating the RDiscount object:

markdown = RDiscount.new("Hello World!", :smart, :filter_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



2. BlueCloth

http://deveiate.org/projects/BlueCloth

> sudo gem install bluecloth


Usage
require "bluecloth"

markdown = BlueCloth.new("

Hi

") or Markdown.new("

Hi

") markdown.to_html



Tip : # BlueCloth has set the top-level 'Markdown' constant
::Markdown = ::BlueCloth unless defined?( ::Markdown )

你可能感兴趣的:(Rails,Java,HTML)