Class: Md2key::Converter
- Inherits:
-
Object
- Object
- Md2key::Converter
- Defined in:
- lib/md2key/converter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #generate_keynote! ⇒ Object
-
#initialize(path) ⇒ Converter
constructor
A new instance of Converter.
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 19 20 21 22 23 |
# File 'lib/md2key/converter.rb', line 13 def generate_keynote! Keynote.activate @markdown..each_with_index do |, index| if index == 0 Keynote.update_master(.title, .lines.join('\n')) next end Keynote.(.title, .lines.join('\n')) end Keynote. end |