Sha256: 923d8ca8a46a255eba54e22b0206f148fdde4597639544aacd490f51c1149185

Contents?: true

Size: 1.11 KB

Versions: 7

Compression:

Stored size: 1.11 KB

Contents

module Garterbelt
  class Doctype < ClosedTag
    ATTRIBUTES = {
      :transitional => "html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"",
      :strict => 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"',
      :frameset => 'html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"',
      :html5 => 'html',
      :html1_1 => 'html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"',
      :basic => 'html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"',
      :mobile => 'html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd"',
      :rdfa => 'html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"'
    }
  
    def rendered_attributes
      ATTRIBUTES[type] || ATTRIBUTES[:transitional]
    end
  
    def template
      "#{indent}<!DOCTYPE #{rendered_attributes}>\n"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
garterbelt-0.1.1 lib/renderers/doctype.rb
garterbelt-0.1.0 lib/renderers/doctype.rb
garterbelt-0.0.9 lib/renderers/doctype.rb
garterbelt-0.0.8 lib/renderers/doctype.rb
garterbelt-0.0.7 lib/renderers/doctype.rb
garterbelt-0.0.6 lib/renderers/doctype.rb
garterbelt-0.0.5 lib/renderers/doctype.rb