Class: Klipbook::Commands::Exporters::MarkdownExporter

Inherits:
Exporter
  • Object
show all
Defined in:
lib/klipbook/commands/exporters/markdown_exporter.rb

Instance Method Summary collapse

Methods inherited from Exporter

#initialize, #run!

Constructor Details

This class inherits a constructor from Klipbook::Commands::Exporters::Exporter

Instance Method Details

#extensionObject



9
10
11
# File 'lib/klipbook/commands/exporters/markdown_exporter.rb', line 9

def extension
  "md"
end

#render_contents(book) ⇒ Object



5
6
7
# File 'lib/klipbook/commands/exporters/markdown_exporter.rb', line 5

def render_contents(book)
  ERB.new(template, 0, '%<>').result(book.get_binding)
end

#templateObject



13
14
15
# File 'lib/klipbook/commands/exporters/markdown_exporter.rb', line 13

def template
  @template ||= File.read(File.join(File.dirname(__FILE__), 'markdown_book_summary.erb'))
end