Upgrade to Pro — share decks privately, control downloads, hide ads and more …

テンプレートの静的解析とリファクタリング

aereal
October 17, 2014

 テンプレートの静的解析とリファクタリング

Talk at テンプレートエンジン Night

aereal

October 17, 2014
Tweet

More Decks by aereal

Other Decks in Programming

Transcript

  1. _post.tt [%- SET formatted = with_ellipsis ? (post.body | truncate)

    : post.body %] <h1>[% post.title %]</h1> <div class="body">[% formatted %]</div>
  2. index.tt [%# blog %] ... [% FOR post IN posts

    %] [% INCLUDE "_post.tt" WITH blog = blog, ... %] [% END %]
  3. T::X::Parser my $template = "my name is [% name %]";

    my $parser = Text::Xslate::Syntax::TTerse->new; my $ast = $parser->parse($template);
  4. ׬