The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Text::Hogan::Compiler - parse templates and output Perl code

VERSION

version 0.03

SYNOPSIS

    use Text::Hogan::Compiler;

    my $compiler = Text::Hogan::Compiler->new;

    my $text = "Hello, {{name}}!";

    my $tokens   = $compiler->scan($text);
    my $tree     = $compiler->parse($scanned, $text);
    my $template = $compiler->generate($parsed, $text);

    say $template->render({ name => "Alex" });

There are various options you can pass to scan, parse, generate and render but I haven't documented them yet.

COPYRIGHT

Copyright (C) 2015 Lokku Ltd.

AUTHOR

Basically statement-for-statement copied from hogan.js by Twitter!

Alex Balhatchet (alex@lokku.com)