Haml
Constants
VERSION = "1.1.0"
Class methods
Macros
def_to_s(filename, indent_width = 2)
Sourceembed(filename, io_name, indent_width = 2)
The delayed {{ run(...) }} expansion follows Crystal stdlib ECR. It lets a fresh macro IO variable be named before its name is sent to the generator. The generator program is resolved relative to THIS file, so both a local checkout and installation as lib/haml work without symlinks or CRYSTAL_PATH tricks. Template filenames, like ECR's, are relative to the build's cwd. Use an absolute path (typically interpolating DIR) for relocatability.
embed_string(source, io_name, filename = "inline.haml", indent_width = 2)
Compile-time inline strings are useful for small fragments and specs. This is not eval: source must be known at compile time. Large inputs should use files because operating systems limit argument length for macro-run tools.
render(filename, indent_width = 2)
Sourcerender_string(source, filename = "inline.haml", indent_width = 2)
Source