Class: Slideshift::Tool::Render::Markdown
- Inherits:
-
Object
- Object
- Slideshift::Tool::Render::Markdown
- Defined in:
- lib/slideshift/tool/render/markdown.rb
Instance Method Summary collapse
-
#initialize(dir) ⇒ Markdown
constructor
A new instance of Markdown.
- #load ⇒ Object
- #render ⇒ Object
Constructor Details
#initialize(dir) ⇒ Markdown
Returns a new instance of Markdown.
39 40 41 |
# File 'lib/slideshift/tool/render/markdown.rb', line 39 def initialize(dir) @dir = dir end |
Instance Method Details
#load ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/slideshift/tool/render/markdown.rb', line 43 def load file = "#{@dir}/presentation.md" unless File.exists?(file) puts "Error: Source file (#{file}) does not exists!" exit(1) end @source = File.read(file) self end |
#render ⇒ Object
53 54 55 |
# File 'lib/slideshift/tool/render/markdown.rb', line 53 def render Kramdown::Document.new(@source, :input => 'Slider').to_html end |