Add preview functionality to frontend.

This commit is contained in:
Tom Preston-Werner
2010-07-31 14:30:38 -04:00
parent 206c8b0712
commit 6438d69775
9 changed files with 274 additions and 22 deletions
+7
View File
@@ -71,6 +71,13 @@ module Precious
redirect "/#{name}"
end
post '/preview' do
format = params['wiki_format']
data = params['text']
wiki = Gollum::Wiki.new($path)
wiki.preview_page("Preview", data, format).formatted_data
end
get %r{/(.+?)/([0-9a-f]{40})} do
name = params[:captures][0]
wiki = Gollum::Wiki.new($path)