Ok, so I've created the following filter;
=== lib/kramdown_filter.rb
module Haml::Filters::KramdownFilter
include Haml::Filters::Base
def render(text)
::Kramdown::Document.new(text).to_html
end
end
==
and I've put the following in environment.rb
==
require 'kramdown_filter'
# define haml filter for kramdown
Haml::Template.options = {
:filters => {
'kramdown' => Haml::Filters::KramdownFilter
}
}
==
But I get a "ActionView::TemplateError (Filter "kramdown" is not defined.)"
error.
Do you HAML gurus know what I'm doing wrong?
Many thanks,
Sid
On 6 August 2010 11:01, Sid Wood <[email protected]> wrote:
> Has anyone made a filter for kramdown?
>
> Cheers,
>
> Sid
>
--
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.