Sha256: c02493b98122c2bbe91651fb8caf508fa2f87803240eb85bdd0332a6bddfef98

Contents?: true

Size: 568 Bytes

Versions: 33

Compression:

Stored size: 568 Bytes

Contents

require 'maruku'
require 'sinatra/base'

module Sinatra
  module Maruku
    def maruku(template, options={}, locals={})
      render :maruku, template, options, locals
    end
    
  private
    def render_maruku(template, data, options, locals, &block)
      maruku_src = render_erb(template, data, options, locals, &block)
      instance = ::Maruku.new(maruku_src, options)
      if block_given?
        # render layout
        instance.to_html_document
      else
        # render template
        instance.to_html
      end  
    end
  end
  
  helpers Maruku
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
tdreyno-middleman-0.4.1 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.5.0 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.5.2 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.5.3 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.5.4 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.5.5 vendor/sinatra-maruku/lib/sinatra/maruku.rb
wbzyl-sinatra-maruku-0.0.8 lib/sinatra/maruku.rb
wbzyl-sinatra-maruku-0.1.0 lib/sinatra/maruku.rb
middleman-0.5.5 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.5.4 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.5.3 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.5.2 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.5.1 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.4.2 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.5.0 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.3.8 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.3.9 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.3.10 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.4.0 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.4.1 vendor/sinatra-maruku/lib/sinatra/maruku.rb