comments

Comments

Template::HAML supports three forms of comments: HTML comments, conditional comments, and silent comments.

HTML comments — /

A line beginning with / is rendered as an HTML comment.

Single-line form:

/ Hello
<!-- Hello -->

If the / line has children indented underneath, they are rendered inside the comment block:

/
  %p hi
<!--
  <p>hi</p>
-->

Conditional comments — /[expr]

Use /[expr] to emit a conditional comment. The bracketed text becomes the condition; surrounding whitespace is stripped.

Inline form:

/[if IE] text
<!--[if IE]>text<![endif]-->

Block form:

/[if IE]
  %p ie only
<!--[if IE]>
  <p>ie only</p>
<![endif]-->

Negated:

/[if !IE] text
<!--[if !IE]>text<![endif]-->

Revealed conditional comments — /![expr]

Prefix the bracket with ! to emit a downlevel-revealed conditional comment. Browsers that don't honor the condition see the wrapped content as plain markup:

/![if !IE] text
<!--[if !IE]><!-->text<!--<![endif]-->

Silent comments — -#

A line beginning with -# is suppressed entirely. Any indented body — including any number of blank lines — is treated as opaque text and produces no output:

%p hi
-# notes:
   arbitrary text $^&* not parsed as HAML
   !!! also opaque
%p bye
<p>hi</p>
<p>bye</p>

Because the body is opaque, you can drop in non-HAML content (e.g. design notes, stale code, scratch markup) without provoking parse errors.

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.