Class: Jekyll::Converters::Haml

Inherits:
Converter
  • Object
show all
Defined in:
lib/jekyll/haml/markup/converter.rb

Instance Method Summary collapse

Instance Method Details

#convert(content) ⇒ Object



27
28
29
# File 'lib/jekyll/haml/markup/converter.rb', line 27

def convert(content)
  get_processor.convert content
end

#extname_listObject



7
8
9
10
11
# File 'lib/jekyll/haml/markup/converter.rb', line 7

def extname_list
  @extname_list ||= haml_conf["haml_ext"].split(",").map do |e|
    ".#{e.downcase}"
  end
end

#get_processorObject



21
22
23
24
25
# File 'lib/jekyll/haml/markup/converter.rb', line 21

def get_processor
  case haml_conf['haml'].downcase
  when 'lib-haml' then return Jekyll::Haml::Parser.new haml_conf
  end
end

#haml_confObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/jekyll/haml/markup/converter.rb', line 31

def haml_conf
  {
    'haml_ext' => 'haml',
    'haml' => 'lib-haml',
    'lib-haml' => {
      attr_wrapper: '"',
      escape_attrs: false
    }
  }
end

#matches(ext) ⇒ Object



13
14
15
# File 'lib/jekyll/haml/markup/converter.rb', line 13

def matches(ext)
  extname_list.include?(ext.downcase)
end

#output_ext(ext) ⇒ Object



17
18
19
# File 'lib/jekyll/haml/markup/converter.rb', line 17

def output_ext(ext)
  '.html'
end