Class: Yarrow::Format::Markdown

Inherits:
Object
  • Object
show all
Includes:
Yarrow::Format::Methods::FrontMatter
Defined in:
lib/yarrow/format/markdown.rb

Instance Method Summary collapse

Methods included from Yarrow::Format::Methods::FrontMatter

included

Constructor Details

#initialize(source) ⇒ Markdown

Returns a new instance of Markdown.



6
7
8
9
# File 'lib/yarrow/format/markdown.rb', line 6

def initialize(source)
  @source = source.to_s
  @document = Kramdown::Document.new(@source)
end

Instance Method Details



23
24
25
# File 'lib/yarrow/format/markdown.rb', line 23

def links
  @links ||= select_links
end

#titleObject



27
28
29
# File 'lib/yarrow/format/markdown.rb', line 27

def title
  @title ||= select_title
end

#to_domObject



15
16
17
# File 'lib/yarrow/format/markdown.rb', line 15

def to_dom
  @document.root
end

#to_htmlObject



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

def to_html
  @document.to_html
end

#to_sObject



11
12
13
# File 'lib/yarrow/format/markdown.rb', line 11

def to_s
  @source
end