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, #bluecloth_version, #kramdown_to_html, #kramdown_version, #maruku_to_html, #maruku_version, #pandoc_ruby_to_html, #pandoc_ruby_to_html_incremental, #pandoc_ruby_to_s5, #pandoc_ruby_to_s5_incremental, #rdiscount_to_html, #rdiscount_version, #redcarpet_to_html, #redcarpet_version, #rpeg_markdown_to_html

Constructor Details

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

Returns a new instance of Wrapper.



30
31
32
33
34
35
# File 'lib/markdown/wrapper.rb', line 30

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

Instance Method Details

#to_htmlObject



37
38
39
40
41
# File 'lib/markdown/wrapper.rb', line 37

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