Sha256: 67237eca71af960bfddb66a385b9890543a76b9b92fa3690dd41a93a2779d8cb

Contents?: true

Size: 416 Bytes

Versions: 2

Compression:

Stored size: 416 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slider-0.2 lib/slider/document.rb
slider-0.1 lib/slider/document.rb