class MarkdownToWord::Document

Constants

YAML_FRONT_MATTER_REGEXP

github.com/jekyll/jekyll/blob/master/lib/jekyll/document.rb#L9

Attributes

html[RW]
template[RW]

Public Class Methods

new(markdown="") click to toggle source
# File lib/markdown_to_word/document.rb, line 9
def initialize(markdown="")
  @raw_markdown = markdown
end

Public Instance Methods

contents() click to toggle source
# File lib/markdown_to_word/document.rb, line 25
def contents
  @contents ||= Htmltoword::Document.create(html, template, true)
end
hash() click to toggle source
# File lib/markdown_to_word/document.rb, line 21
def hash
  @hash ||= Digest::MD5.hexdigest(html)
end
markdown() click to toggle source
# File lib/markdown_to_word/document.rb, line 13
def markdown
  @raw_markdown.split(YAML_FRONT_MATTER_REGEXP).last
end

Private Instance Methods

raw_html() click to toggle source
# File lib/markdown_to_word/document.rb, line 31
def raw_html
  @raw_html ||= HTML::Pipeline::MarkdownFilter.new(markdown).call
end