Sha256: f58bbdfea81482b597ebb8b77add8a0be634efb018caf555424c8bca01967ab9

Contents?: true

Size: 548 Bytes

Versions: 19

Compression:

Stored size: 548 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(data, options, locals, &block)
      maruku_src = render_erb(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

19 entries across 19 versions & 3 rubygems

Version Path
tdreyno-middleman-0.2.4 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.2.5 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.2.6 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.2.7 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.2.8 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.2.9 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.0 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.1 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.10 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.2 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.3 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.4 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.7 vendor/sinatra-maruku/lib/sinatra/maruku.rb
tdreyno-middleman-0.3.8 vendor/sinatra-maruku/lib/sinatra/maruku.rb
wbzyl-sinatra-maruku-0.1.1 lib/sinatra/maruku.rb
wbzyl-sinatra-maruku-0.10.1 lib/sinatra/maruku.rb
middleman-0.3.6 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.3.7 vendor/sinatra-maruku/lib/sinatra/maruku.rb
middleman-0.3.5 vendor/sinatra-maruku/lib/sinatra/maruku.rb