Template::HAML
Every page of the Template::HAML manual, in reading order.
- Overview The latest version of this documentation lives at https://gdonald.github.io/Template-HAML/.
- Getting Started A typical project that uses Template::HAML keeps its templates under an app/views/ (or any other) directory, organized by controller / feature, with the...
- Tags A tag in HAML is introduced by a sigil at the start of a line:
- Attributes Template::HAML supports a Ruby-style attribute hash on any tag:
- 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...
- 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...
- Comments Template::HAML supports three forms of comments: HTML comments, conditional comments, and silent comments.
- Plain text Any line whose first non-space character is not a HAML sigil is plain text. Plain text is emitted as-is at the current indent level.
- Whitespace Template::HAML supports HAML's whitespace-removal modifiers and whitespace-preservation behaviors so you can control how generated HTML is laid out.
- Embedded code Template::HAML lets you embed Raku expressions directly in a template. Each embedded line begins with an output operator and is followed by a Raku...
- Control flow Template::HAML recognizes a small set of control-flow keywords that follow the silent operator -. Each opens an indented block whose body is conditionally...
- Filters A filter line begins with : followed by the filter name. The filter's body is the indented block beneath it. Each filter passes its body through a handler...
- Layouts and partials Template::HAML supports rendering templates from disk, composing them into layouts, and re-using fragments via partials. These features build on a small...
- Helpers Template::HAML::Helpers exports a small set of convenience subroutines that embedded Raku code can call directly. They are visible to every =, !=, &=, and...
- Render context HAML.render accepts a :context named argument — a Raku object whose methods become reachable inside templates as bare identifiers in expression position....
- Configuration Rendering options live on a Template::HAML::Config object. Pass one to HAML.render(:config(...)) for per-render overrides, or to HAML.new(:config(...))...
- Plugins Template::HAML::Plugin is the public surface for bundling related hooks — visitors, tag transformers, filters, and the markdown backend — into a single...
- API Template::HAML exposes a layered API: a one-call render for most callers, streaming and cached-compile variants for performance, an optional direct-emit...
- CLI Template::HAML ships with a haml script for rendering and checking templates from the shell.
- Canonical form haml fmt rewrites a .haml source file into its canonical form: the single representative chosen from every set of HAML sources that parse to the same AST....
- Tests Template::HAML has two parallel test suites:
- Benchmarks The repo ships two parallel bench harnesses that compare the two codegen paths — the direct-emit codegen (default) and the AST walker (:emit<ast>, see...