Class: Slideshift::Tool::Render::Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/slideshift/tool/render/markdown.rb

Instance Method Summary collapse

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

#loadObject



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

#renderObject



53
54
55
# File 'lib/slideshift/tool/render/markdown.rb', line 53

def render
  Kramdown::Document.new(@source, :input => 'Slider').to_html
end