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
|
# File 'lib/kramdown_filter.rb', line 4
def options
c = Radiant::Config
o = {
:auto_ids => { :default => true, :type => :boolean },
:auto_id_prefix => { :default => '', :type => :string },
:parse_block_html => { :default => false, :type => :boolean },
:parse_span_html => { :default => true, :type => :boolean },
:footnote_nr => { :default => 1, :type => :integer },
:coderay_wrap => { :default => :div, :type => :symbol },
:coderay_line_numbers => { :default => :inline, :type => :symbol },
:coderay_line_number_start => { :default => 1, :type => :integer },
:coderay_tab_width => { :default => 0, :type => :integer },
:coderay_bold_every => { :default => 10, :type => :integer },
:coderay_css => { :default => :style, :type => :symbol },
:entity_output => { :default => :as_char, :type => :symbol },
:toc_levels => { :default => [1, 2, 3, 4, 5, 6], :type => :array }
}
o.keys.each { |key|
if c["kramdown.#{key.to_s}"]
case o[key][:type]
when :boolean
boolean = c["kramdown.#{key.to_s}"] == "true" ? true : false
o[key][:default] = boolean
when :integer
o[key][:default] = c["kramdown.#{key.to_s}"].to_i
when :string
o[key][:default] = c["kramdown.#{key.to_s}"]
when :symbol
symbol = c["kramdown.#{key.to_s}"] != "nil" ? c["kramdown.#{key.to_s}"].to_sym : nil
o[key][:default] = symbol
end
end
}
return o
end
|