class Markdown::Converter

todo: use Converter inside Wrapper to avoid duplication

Public Class Methods

new( lib, mn_to_html, mn_version ) click to toggle source
# File lib/markdown/wrapper.rb, line 8
def initialize( lib, mn_to_html, mn_version )
  @lib         = lib
  @mn_to_html  = mn_to_html
  @mn_version  = mn_version
end

Public Instance Methods

convert( text, options={} ) click to toggle source
# File lib/markdown/wrapper.rb, line 14
def convert( text, options={} )
  # call markdown filter; turn markdown lib name into method_name (mn)
  # eg. rpeg-markdown =>  rpeg_markdown_to_html
  send( @mn_to_html, text, options )  # call 1st configured markdown engine e.g. kramdown_to_html( content )
end
version() click to toggle source
# File lib/markdown/wrapper.rb, line 20
def version
  send( @mn_version )  # call 1st configured markdown engine e.g. kramdown_version
end