Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make default markup changeable through sinatra settings

  • Loading branch information...
commit 4e9111976eb3b237ab8a5309670c628698a86d5b 1 parent 5163f11
Hulihan Applications authored December 22, 2011
13  README.md
Source Rendered
@@ -428,7 +428,20 @@ To delete a page and commit the change:
428 428
 
429 429
     wiki.delete_page(page, commit)
430 430
 
  431
+### RACK
431 432
 
  433
+You can also run gollum with any rack-compatible server by placing this config.ru 
  434
+file inside your wiki repository. This allows you to utilize any Rack middleware 
  435
+like Rack::Auth, OmniAuth, etc.   
  436
+
  437
+    #!/usr/bin/env ruby
  438
+    require 'rubygems'
  439
+    require 'gollum/frontend/app'
  440
+    
  441
+    gollum_path = File.expand_path(File.dirname(__FILE__)) # CHANGE THIS TO POINT TO YOUR OWN WIKI REPO
  442
+    Precious::App.set(:default_markup, :markdown) # set your favorite markup language
  443
+    run Precious::App
  444
+ 
432 445
 ## CONTRIBUTE
433 446
 
434 447
 If you'd like to hack on Gollum, start by forking my repo on GitHub:
3  lib/gollum/frontend/app.rb
@@ -15,7 +15,8 @@ class App < Sinatra::Base
15 15
     # We want to serve public assets for now
16 16
     set :public_folder, "#{dir}/public"
17 17
     set :static,         true
18  
-
  18
+    set :default_markup, :markdown
  19
+    
19 20
     set :mustache, {
20 21
       # Tell mustache where the Views constant lives
21 22
       :namespace => Precious,
6  lib/gollum/frontend/templates/create.mustache
@@ -10,6 +10,8 @@
10 10
 </div>
11 11
 <script type="text/javascript">
12 12
 jQuery(document).ready(function() {
13  
-  $.GollumEditor({ NewFile: true });
  13
+  $.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
14 14
 });
15  
-</script>
  15
+</script>
  16
+
  17
+{{something}}
4  lib/gollum/frontend/views/create.rb
@@ -39,6 +39,10 @@ def page_name
39 39
       def formats
40 40
         super(:markdown)
41 41
       end
  42
+      
  43
+      def default_markup
  44
+        Precious::App.settings.default_markup
  45
+      end 
42 46
     end
43 47
   end
44 48
 end

0 notes on commit 4e91119

Please sign in to comment.
Something went wrong with that request. Please try again.