Sha256: a98dfbdcfedf9bb4e14cd2c2a6c1193322c7abed3db4ca42b7fa27631bd5dfb5
Contents?: true
Size: 773 Bytes
Versions: 42
Compression:
Stored size: 773 Bytes
Contents
require 'rdiscount' require 'liquid' module Webpage def self.generate(version) screenshots = RDiscount.new(File.read("top.screenshots")).to_html readme = File.expand_path("../../README.markdown", __FILE__) raise "No README" unless File.size?(readme) md = File.read(readme).split(/^\s*$/) insert_before = md.grep(/^A quick overview of/) insert_at = md.index insert_before.first md.insert(insert_at, screenshots) md = md.join("\n\n") # for some reason markdown inserts extra blank lines content = RDiscount.new(md).to_html.gsub(/\n\n{3,}/, "\n\n") template = File.read("soywiki-template.html") out = Liquid::Template.parse(template).render 'content' => content, 'timestamp' => Time.now.to_i, 'version' => version end end
Version data entries
42 entries across 42 versions & 1 rubygems