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.4.8 website/gen.rb
soywiki-0.4.7 website/gen.rb
soywiki-0.4.6 website/gen.rb
soywiki-0.4.5 website/gen.rb
soywiki-0.4.4 website/gen.rb
soywiki-0.4.3 website/gen.rb
soywiki-0.4.2 website/gen.rb
soywiki-0.4.1 website/gen.rb
soywiki-0.4.0 website/gen.rb
soywiki-0.3.9 website/gen.rb
soywiki-0.3.8 website/gen.rb
soywiki-0.3.7 website/gen.rb
soywiki-0.3.6 website/gen.rb
soywiki-0.3.5 website/gen.rb
soywiki-0.3.4 website/gen.rb
soywiki-0.3.3 website/gen.rb
soywiki-0.3.2 website/gen.rb
soywiki-0.3.1 website/gen.rb
soywiki-0.3.0 website/gen.rb
soywiki-0.2.9 website/gen.rb