Sha256: 884def41c3cda0fe343178e78aed956bfe0b01ec3e3bbd196a12ffb9937ffae5
Contents?: true
Size: 710 Bytes
Versions: 34
Compression:
Stored size: 710 Bytes
Contents
require 'liquid' require 'rdiscount' top = RDiscount.new(File.read("top.markdown")).to_html readme = File.expand_path("../../README.markdown", __FILE__) raise "no README" unless File.size?(readme) middle_markdown = File.read(readme).split(/^\s*$/) middle_markdown = middle_markdown[2..-1].join("\n\n") middle = RDiscount.new(middle_markdown).to_html # for some reason markdown inserts extra blank lines middle = middle.gsub(/\n\n{3,}/, "\n\n") bottom = RDiscount.new(File.read("bottom.markdown")).to_html content = [top, middle, bottom].join("\n\n") template = File.read("vmail-template.html") out = Liquid::Template.parse(template).render 'content' => content, 'timestamp' => Time.now.to_i puts out
Version data entries
34 entries across 34 versions & 1 rubygems