21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/ichiban/markdown.rb', line 21
def self.require_markdown
unless @markdown_loaded
case Ichiban.try_require('kramdown', 'multimarkdown', 'redcarpet', 'maruku', 'rdiscount')
when 'kramdown'
@strategy = :kramdown
when 'multimarkdown'
@strategy = :multimarkdown
when 'redcarpet'
@redcarpet = Redcarpet::Markdown.new(Redcarpet::Render::XHTML.new)
@strategy = :redcarpet
when 'maruku'
@strategy = :maruku
when 'rdiscount'
@strategy = :rdiscount
else
raise("Your Ichiban project contains at least one Markdown file. To process it, " +
"you need to gem install one of: rpeg-multimarkdown redcarpet maruku rdiscount.")
end
@markdown_loaded = true
end
end
|