Class: WriteDown::Model::Slide
- Defined in:
- lib/write_down/model/slide.rb
Instance Attribute Summary
Attributes inherited from Base
#content, #created_at, #draft, #link_to
Instance Method Summary collapse
Methods inherited from Base
#converter, #initialize, #read_from_head
Constructor Details
This class inherits a constructor from WriteDown::Model::Base
Instance Method Details
#body ⇒ Object
13 14 15 |
# File 'lib/write_down/model/slide.rb', line 13 def body PandocRuby.convert(@content, { f: :org, to: :html5}, 'no-highlight') end |
#build ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/write_down/model/slide.rb', line 17 def build output = Pathname.new(@target_file) output.dirname.mkpath final_content = render output.write(final_content) self end |
#render ⇒ Object
8 9 10 11 |
# File 'lib/write_down/model/slide.rb', line 8 def render template = File.('../../erb/slide.erb', __FILE__) html_string = ERB.new(File.read(template)).result(binding) end |