Class: Transmuter::Format::Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/transmuter/format/markdown.rb

Constant Summary collapse

REDCARPET_OPTIONS =
[:autolink, :no_intraemphasis, :fenced_code, :gh_blockcode]

Instance Method Summary collapse

Constructor Details

#initialize(markdown, options = {}) ⇒ Markdown

Returns a new instance of Markdown.



8
9
10
11
# File 'lib/transmuter/format/markdown.rb', line 8

def initialize(markdown, options = {})
  parse_options(options)
  @markdown = markdown
end

Instance Method Details

#to_htmlObject



19
20
21
22
# File 'lib/transmuter/format/markdown.rb', line 19

def to_html
  html = Html.new(parse_markdown, get_options)
  html.process
end

#to_pdfObject



13
14
15
16
17
# File 'lib/transmuter/format/markdown.rb', line 13

def to_pdf
  html = to_html
  pdf = Pdf.new(html, get_options)
  pdf.process
end