android.moparisthebest.org/plugins/haml.rb

27 lines
475 B
Ruby
Raw Normal View History

2013-03-09 20:25:04 -05:00
require File.expand_path('../../lib/colors.rb', __FILE__)
2011-04-17 23:49:30 -04:00
module Jekyll
require 'haml'
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end
def output_ext(ext)
".html"
end
def convert(content)
begin
engine = Haml::Engine.new(content)
engine.render
rescue StandardError => e
2013-03-09 20:25:04 -05:00
$stderr.puts ("!!! HAML Error: " + e.message).red
2011-04-17 23:49:30 -04:00
end
end
end
end