Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (21 sloc) 0.535 kb
require 'bundler/setup'
require 'sinatra/base'
require 'haml'
require 'github/markup'
class Preview < Sinatra::Base
set :views, File.dirname(__FILE__) + '/views'
set :public_folder, File.dirname(__FILE__) + '/public'
get '/' do
haml :index
end
post '/render' do
format = params[:format]
data = params[:data]
GitHub::Markup.render("tmp.#{format}", data)
end
get '/help/:format' do
format = params[:format]
file = "help/help.#{format}"
GitHub::Markup.render(file, File.read(file))
end
end
Jump to Line
Something went wrong with that request. Please try again.