indentation

Indentation

HAML uses indentation to express nesting. A line that's indented further than the previous line becomes a child of that line; a line at the same indent is a sibling; a line at a shallower indent closes one or more parents.

Two-space indent

Template::HAML currently expects two-space indentation:

%section.container
  %h1 Title
  %ul
    %li Foo
    %li Bar
<section class='container'>
  <h1>Title</h1>
  <ul>
    <li>Foo</li>
    <li>Bar</li>
  </ul>
</section>

Inconsistent indentation is rejected

An odd-spaced indent is rejected with X::IllegalIndent:

%section
   %h1 Title
Illegal indentation

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.