kramdown

10 views
Skip to first unread message

Joel VanderWerf

unread,
Jun 27, 2010, 10:11:46 PM6/27/10
to Webby

In case anyone wants to use kramdown in place of markdown or maruku,
here is the trivial adaptation of the markdown filter to use it. Just
name it kramdown.rb and put it in your project's lib dir. The first
difference I've noticed is that footnote layout is better. Yay, kramdown!


# Render text via markdown using the Kramdown library.
if try_require('kramdown', 'kramdown')

Webby::Filters.register :kramdown do |input|
Kramdown::Document.new(input).to_html
end

# Otherwise raise an error if the user tries to use kramdown
else
Webby::Filters.register :kramdown do |input|
raise Webby::Error, "'kramdown' must be installed to use the
kramdown filter"
end
end

# EOF


Reply all
Reply to author
Forward
0 new messages