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

Version Path
soywiki-0.2.3 website/gen.rb
soywiki-0.2.2 website/gen.rb
soywiki-0.2.1 website/gen.rb
soywiki-0.2.0 website/gen.rb
soywiki-0.1.9 website/gen.rb
soywiki-0.1.6 website/gen.rb
soywiki-0.1.5 website/gen.rb
soywiki-0.1.4 website/gen.rb
soywiki-0.1.3 website/gen.rb
soywiki-0.1.2 website/gen.rb
soywiki-0.1.1 website/gen.rb
soywiki-0.0.9 website/gen.rb
soywiki-0.0.8 website/gen.rb
soywiki-0.0.7 website/gen.rb
soywiki-0.0.6 website/gen.rb
soywiki-0.0.5 website/gen.rb
soywiki-0.0.4 website/gen.rb