Sha256: 589670b73da94552a9cbaea03b4c213e368ea21ef099e1d4a8d3249cbcb53406

Contents?: true

Size: 509 Bytes

Versions: 10

Compression:

Stored size: 509 Bytes

Contents

module Sinatra
  class Base
    def markdown sym
      md = File.expand_path(File.join(Caboodle::App.root,"config","#{sym.to_s}.md"))
      unless File.exists?(md)
        md = File.expand_path(File.join(Caboodle::App.root,"pages","#{sym.to_s}.md"))
      end
      if File.exists?(md)
        @content = Maruku.new(open(md).read).to_html_document
        haml ".page.#{sym.to_s}.thin_page= @content"
      else
        haml "%h2.#{sym.to_s}= 'Sorry - #{sym.to_s}.md was not found"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
caboodle-0.3.0 lib/caboodle/markdown.rb
caboodle-0.2.30 lib/caboodle/markdown.rb
caboodle-0.2.29 lib/caboodle/markdown.rb
caboodle-0.2.28 lib/caboodle/markdown.rb
caboodle-0.2.27 lib/caboodle/markdown.rb
caboodle-0.2.26 lib/caboodle/markdown.rb
caboodle-0.2.25 lib/caboodle/markdown.rb
caboodle-0.2.24 lib/caboodle/markdown.rb
caboodle-0.2.23 lib/caboodle/markdown.rb
caboodle-0.2.22 lib/caboodle/markdown.rb