-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.example.rb
58 lines (52 loc) · 3.36 KB
/
config.example.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
require 'omnigollum'
require 'omniauth-ldap'
# ----- config -----
wiki_options = {
:port => 3000,
:allow_uploads => true,
:per_page_uploads => true,
:follow_renames => false,
:display_metadata => false,
:css => true,
:h1_title => true,
:emoji => true,
}
Precious::App.set(:wiki_options, wiki_options)
# If present, undefine the :FORMAT_NAMES constant to avoid the
# "already initialized constant FORMAT_NAMES" warning
#Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES
# Redefine the :FORMAT_NAMES constant to limit the available
# formats on the editor to only markdown
#Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown" }
# ----- auth -----
auth_options = {
# OmniAuth::Builder block is passed as a proc
:providers => Proc.new do
provider :ldap,
:title => 'Identification',
:host => 'ldap.com',
:port => 389,
:uid => 'cn',
:method => :plain,
:base => 'dc=example'
end,
:authorized_users => nil,
:dummy_auth => false,
# If you want to make pages private:
# :protected_routes => ['/*'],
# Specify committer name as just the user name
:author_format => Proc.new { |user| user.name },
# Specify committer e-mail as just the user e-mail
:author_email => Proc.new { |user| user.email }
}
# Precious::App.enable :session
Precious::App.set(:omnigollum, auth_options)
Precious::App.register Omnigollum::Sinatra
# ----- misc config -----
GitHub::Markup::Markdown::MARKDOWN_GEMS['kramdown'] = proc { |content|
Kramdown::Document.new(content,
:input => "GFM",
:auto_ids => false,
:math_engine => nil,
:smart_quotes => ["'", "'", '"', '"'].map{|char| char.codepoints.first}).to_html
} # This shows the defaults options for kramdown (on gollum 5.x), change the options hash to get the desired results.