Sha256: bc45a6a764256bb3b11c44dbf210cfbbbe763c70a27d990893228c47ab7c8456
Contents?: true
Size: 757 Bytes
Versions: 17
Compression:
Stored size: 757 Bytes
Contents
require 'liquid' require 'rdiscount' 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*$/) headers = md.grep(/## Prerequisites/) insert_at = md.index headers.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
17 entries across 17 versions & 1 rubygems