Skip to content

Instantly share code, notes, and snippets.

@acidlemon
Created August 21, 2014 02:16
Show Gist options
  • Save acidlemon/66c041b0784c0b71776e to your computer and use it in GitHub Desktop.
Save acidlemon/66c041b0784c0b71776e to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use utf8;
use Test::More;
use Text::Xslate;
use Data::Section::Simple;
my $tx = Text::Xslate->new(
syntax => 'TTerse',
path => [ Data::Section::Simple->new()->get_data_section() ],
);
my $result = $tx->render('include/index.tx', { name => 'Bob' });
like $result, qr/Hello World, Bob!/;
done_testing;
__DATA__
@@ include/index.tx
[% INCLUDE "include/parts.tx" %]
@@ include/parts.tx
Hello World, [% name %]!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment