Created
March 28, 2013 02:23
-
-
Save satomixx/5260015 to your computer and use it in GitHub Desktop.
Perl Sledge TemplateToolkit ref: http://qiita.com/items/197602a8d35c52762a41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[% aaaa %] | |
と | |
[%- aaaa -%] | |
などの違い。。。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Foo | |
[% a = 10 %] | |
Bar | |
Output: | |
Foo | |
Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Foo <----------. | |
| | |
,---(PRE_CHOMP)----' | |
| | |
`-- [% a = 10 %] --. | |
| | |
,---(POST_CHOMP)---' | |
| | |
`-> Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
これと、 | |
[% FOREACH user IN userlist %][%- user -%][% END %] | |
これは一緒のことを意味している、ということ。 | |
[% FOREACH user IN userlist %][% user %][% END %] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[%= if aaa =%] | |
とか | |
[%~ if aaa ~%] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Constant Value Tag Modifier | |
---------------------------------- | |
CHOMP_NONE 0 + | |
CHOMP_ONE 1 - | |
CHOMP_COLLAPSE 2 = | |
CHOMP_GREEDY 3 ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $template = Template->new({ | |
PRE_CHOMP => '~', | |
POST_CHOMP => '-', | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
これが、 | |
[% FOREACH user IN userlist %] | |
User: [% user +%][% END %] | |
これと同じ様になるという事ですね。 | |
[% FOREACH user IN userlist %]User: [% user %][% END %] | |
打ち消し版です。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment