Class: Markdown::Wrapper

Inherits:
Object
  • Object
show all
Includes:
Engine
Defined in:
lib/markdown/wrapper.rb

Instance Method Summary collapse

Methods included from Engine

#bluecloth_to_html, #kramdown_to_html, #maruku_to_html, #pandoc_ruby_to_html, #pandoc_ruby_to_html_incremental, #pandoc_ruby_to_s5, #pandoc_ruby_to_s5_incremental, #rdiscount_to_html, #redcarpet_to_html, #rpeg_markdown_to_html

Constructor Details

#initialize(lib, mn, content, options = {}) ⇒ Wrapper

Returns a new instance of Wrapper.



5
6
7
8
9
10
# File 'lib/markdown/wrapper.rb', line 5

def initialize( lib, mn, content, options={} )
  @lib      = lib      
  @mn       = mn
  @content  = content
  @options  = options
end

Instance Method Details

#to_htmlObject



12
13
14
15
16
# File 'lib/markdown/wrapper.rb', line 12

def to_html
  # call markdown filter; turn markdown lib name into method_name (mn)
  # eg. rpeg-markdown =>  rpeg_markdown_to_html
  send( @mn, @content, @options )  # call 1st configured markdown engine e.g. kramdown_to_html( content )
end