Class: HJ7::Slim::SlimConverter

Inherits:
Jekyll::Converter
  • Object
show all
Defined in:
lib/hj7/slim_converter.rb

Instance Method Summary collapse

Instance Method Details

#convert(content) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/hj7/slim_converter.rb', line 17

def convert(content)
  begin
    Slim::Template.new({}) { content }.render
  rescue StandardError => e
    puts 'Slim error:' + e.message
  end
end

#matches(ext) ⇒ Object



9
10
11
# File 'lib/hj7/slim_converter.rb', line 9

def matches(ext)
  ext =~ /slim/i
end

#output_ext(ext) ⇒ Object



13
14
15
# File 'lib/hj7/slim_converter.rb', line 13

def output_ext(ext)
  '.html'
end