Skip to content

Instantly share code, notes, and snippets.

@robheittman
Forked from dtjm/haml_converter.rb
Created December 21, 2010 00:21
Show Gist options
  • Save robheittman/749282 to your computer and use it in GitHub Desktop.
Save robheittman/749282 to your computer and use it in GitHub Desktop.
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
puts "!!! HAML Error: " + e.message
end
end
end
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /sass/i
end
def output_ext(ext)
".css"
end
def convert(content)
begin
engine = Sass::Engine.new(content)
engine.render
rescue StandardError => e
puts "!!! SASS Error: " + e.message
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment