Class: Md2key::Markdown

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Markdown

Returns a new instance of Markdown.



9
10
11
12
13
# File 'lib/md2key/markdown.rb', line 9

def initialize(path)
  markdown = File.read(path)
  xhtml    = to_xhtml(markdown)
  @ast     = Oga.parse_xml(xhtml)
end

Instance Method Details

#cover ⇒ Object



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

def cover
  cached_slides.first
end

#slides ⇒ Object



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

def slides
  cached_slides[1..-1]
end