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

Version Path
soywiki-0.7.0 website/gen.rb
soywiki-0.6.7 website/gen.rb
soywiki-0.6.6 website/gen.rb
soywiki-0.6.5 website/gen.rb
soywiki-0.6.4 website/gen.rb
soywiki-0.6.3 website/gen.rb
soywiki-0.6.2 website/gen.rb
soywiki-0.6.1 website/gen.rb
soywiki-0.6.0 website/gen.rb
soywiki-0.5.9 website/gen.rb
soywiki-0.5.8 website/gen.rb
soywiki-0.5.7 website/gen.rb
soywiki-0.5.6 website/gen.rb
soywiki-0.5.5 website/gen.rb
soywiki-0.5.4 website/gen.rb
soywiki-0.5.3 website/gen.rb
soywiki-0.5.2 website/gen.rb
soywiki-0.5.1 website/gen.rb
soywiki-0.5.0 website/gen.rb
soywiki-0.4.9 website/gen.rb