require 'erb' module Slider class Document def initialize(name, template) @name = name @file = File.read("#{name}.md") @template = ERB.new(File.read(File.expand_path(File.join('..', '..', '..', 'templates', "#{template}.erb"), __FILE__))) end def render @content = Kramdown::Document.new(@file, :input => 'Slider').to_html @template.result(binding) end end end