Class: Md2key::Converter

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Converter

Returns a new instance of Converter.



9
10
11
# File 'lib/md2key/converter.rb', line 9

def initialize(path)
  @markdown = Markdown.new(path)
end

Class Method Details

.convert_markdown(path) ⇒ Object



3
4
5
6
7
# File 'lib/md2key/converter.rb', line 3

def self.convert_markdown(path)
  abort "md2key: `#{path}` does not exist" unless File.exist?(path)

  self.new(path).generate_keynote!
end

Instance Method Details

#generate_keynote! ⇒ Object



13
14
15
16
17
18
# File 'lib/md2key/converter.rb', line 13

def generate_keynote!
  prepare_document_base
  generate_contents
ensure
  Keynote.delete_template_slide
end