Class: Jekyll::Converters::Haml
- Inherits:
-
Converter
- Object
- Converter
- Jekyll::Converters::Haml
- Defined in:
- lib/jekyll/haml/markup/converter.rb
Instance Method Summary collapse
- #convert(content) ⇒ Object
- #extname_list ⇒ Object
- #get_processor ⇒ Object
- #haml_conf ⇒ Object
- #matches(ext) ⇒ Object
- #output_ext(ext) ⇒ Object
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_list ⇒ Object
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_processor ⇒ Object
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_conf ⇒ Object
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 |