Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 387 Bytes
require "rubygems"
require "sinatra"
require "haml"
require "sass"
get "/" do
redirect "/index.html"
end
get "/index.:format" do |format|
@format = format
@styles = sass :prince
html = haml :index
if format == "pdf"
IO.popen("prince -v -i html -s views/pdf.css - output/index.pdf", "w") { |f| f.write(html) }
send_file("output/index.pdf")
else
html
end
end