doctype

Doctype

A line beginning with !!! declares the document's doctype. It must be the first non-blank line of the template; placing it after any tag or statement raises X::HAML::DoctypeNotFirst.

Argument-less form

!!!
<!DOCTYPE html>

With no argument, !!! emits the format-default doctype. The format comes from the format config option and the default is html5. The other formats produce different defaults:

formatArgument-less !!! output
html5<!DOCTYPE html>
html4<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
xhtml<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Named variants (below) ignore the format option and always emit the exact doctype the variant names.

Named variants

SourceOutput
!!! 5<!DOCTYPE html>
!!! 1.1XHTML 1.1
!!! StrictXHTML 1.0 Strict
!!! FramesetXHTML 1.0 Frameset
!!! MobileXHTML Mobile 1.2
!!! RDFaXHTML+RDFa 1.0
!!! BasicXHTML Basic 1.1
!!! XML<?xml version='1.0' encoding='utf-8' ?>
!!! XML <enc>XML declaration with the given encoding
!!! XML iso-8859-1
<?xml version='1.0' encoding='iso-8859-1' ?>

Errors

An unrecognized variant raises X::HAML::UnknownDoctype:

!!! Bogus
[HAML source:1:1] unknown doctype 'Bogus'; expected one of: 5 1.1 Strict Frameset Mobile RDFa Basic XML

Template::HAML v0.9.5

HAML template engine

Authors

  • Greg Donald

License

Artistic-2.0

Dependencies

Provides

  • Template::HAML
  • Template::HAML::Actions
  • Template::HAML::CLI
  • Template::HAML::Cache
  • Template::HAML::Codegen
  • Template::HAML::Comment
  • Template::HAML::Config
  • Template::HAML::Context
  • Template::HAML::DirectCodegen
  • Template::HAML::DirectEmit
  • Template::HAML::Doctype
  • Template::HAML::Eval
  • Template::HAML::Filter
  • Template::HAML::Filters
  • Template::HAML::Format
  • Template::HAML::Grammar
  • Template::HAML::Helpers
  • Template::HAML::HelpersRole
  • Template::HAML::Interpolation
  • Template::HAML::Lint
  • Template::HAML::Multiline
  • Template::HAML::Node
  • Template::HAML::Plain
  • Template::HAML::Plugin
  • Template::HAML::Renderer
  • Template::HAML::Statement
  • Template::HAML::Tag
  • Template::HAML::TagTransformers
  • Template::HAML::ViewContext
  • Template::HAML::Visitor
  • Template::HAML::Watch
  • Template::HAML::X

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.