Permalink
Browse files

Make default markup changeable through sinatra settings

  • Loading branch information...
hulihanapplications committed Dec 23, 2011
1 parent 5163f11 commit 4e9111976eb3b237ab8a5309670c628698a86d5b
Showing with 23 additions and 3 deletions.
  1. +13 −0 README.md
  2. +2 −1 lib/gollum/frontend/app.rb
  3. +4 −2 lib/gollum/frontend/templates/create.mustache
  4. +4 −0 lib/gollum/frontend/views/create.rb
View
@@ -428,7 +428,20 @@ To delete a page and commit the change:
wiki.delete_page(page, commit)
+### RACK
+You can also run gollum with any rack-compatible server by placing this config.ru
+file inside your wiki repository. This allows you to utilize any Rack middleware
+like Rack::Auth, OmniAuth, etc.
+
+ #!/usr/bin/env ruby
+ require 'rubygems'
+ require 'gollum/frontend/app'
+
+ gollum_path = File.expand_path(File.dirname(__FILE__)) # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO
+ Precious::App.set(:default_markup, :markdown) # set your favorite markup language
+ run Precious::App
+
## CONTRIBUTE
If you'd like to hack on Gollum, start by forking my repo on GitHub:
@@ -15,7 +15,8 @@ class App < Sinatra::Base
# We want to serve public assets for now
set :public_folder, "#{dir}/public"
set :static, true
-
+ set :default_markup, :markdown
+
set :mustache, {
# Tell mustache where the Views constant lives
:namespace => Precious,
@@ -10,6 +10,8 @@
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
- $.GollumEditor({ NewFile: true });
+ $.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
});
-</script>
+</script>
+
+{{something}}
@@ -39,6 +39,10 @@ def page_name
def formats
super(:markdown)
end
+
+ def default_markup
+ Precious::App.settings.default_markup
+ end
end
end
end

0 comments on commit 4e91119

Please sign in to comment.