Class: HtmlEmailCreator::Formatters::Markdown

Inherits:
HtmlEmailCreator::Formatter show all
Defined in:
lib/html_email_creator/formatters/markdown.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from HtmlEmailCreator::Formatter

#find, #find_by_filename

Constructor Details

#initialize(text, settings) ⇒ Markdown

Returns a new instance of Markdown.



14
15
16
17
# File 'lib/html_email_creator/formatters/markdown.rb', line 14

def initialize(text, settings)
  super
  @document = Kramdown::Document.new(text, :input => 'markdown')
end

Class Method Details

.extensionObject



6
7
8
# File 'lib/html_email_creator/formatters/markdown.rb', line 6

def self.extension
  "md"
end

.idObject



10
11
12
# File 'lib/html_email_creator/formatters/markdown.rb', line 10

def self.id
  :md
end

Instance Method Details

#formatObject



19
20
21
# File 'lib/html_email_creator/formatters/markdown.rb', line 19

def format
  @output ||= @document.to_html.strip
end