Module: Hamlit::Compilers::Doctype

Included in:
Hamlit::Compiler
Defined in:
lib/hamlit/compilers/doctype.rb

Instance Method Summary collapse

Instance Method Details

#on_haml_doctype(format, type) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/hamlit/compilers/doctype.rb', line 4

def on_haml_doctype(format, type)
  if type == 'XML'
    return xml_doctype_tag(format)
  elsif type
    return doctype_tag(type)
  end

  case format
  when :html4
    doctype_tag(:transitional)
  when :html5
    doctype_tag(:html)
  when :xhtml
    doctype_tag(:transitional)
  else
    doctype_tag(format)
  end
end