__END__

=head1 TEMPLATE PROCESSING

As stated in the L<paper|"/THE PAPER">, one only needs four template constructs:
data interpolation, conditional template inclusion based upon presence/absence
of an boolean data, recursive template references, and most importantly, template
application to a multi-valued data.

In addition to that, Plift also provides a mechanism to remove template elements
based upon presence/absence of a boolean data. Any other custom processing must
be implemented via a L</"CUSTOM HANDLER">.


=head2 DATA INTERPOLATION

Almost any type of data can be made available to the template via L</Plift::Context/set>.
Plift will try to render the best string representation for the each type of data.
Templates can reference data via the special HTML attribute C< data-render="foo" > or
HTML element C<< <render data="foo"> >>.

Consider the following data:

    $tempalte->set(
        name => 'Carlos Fernando',
        now  => DateTime->now,
        is_admin => 1,
        cart => {
            total => 500,
            items => [
                { name => 'Item 01', price => 100, quantity => 1 },
                { name => 'Item 02', price => 200, quantity => 2 },
            ]
        }
    );

when consumed by this template:

    <div>
        Checkout page for <render data="name">Jhon Doe</render>,
        rendered at <render data="now" format="%F %T">2016-06-30 14:55:43</render>
        <br/>

        Total Price: <b data-render="cart.total">100.0</b>
    </div>

    <table>
        <tr><td>Name</td><td>Quantity</td><td>Unit Price</td></tr>
        <tr data-render="cart.items">
            <td data-render="name">item 1</td>
            <td data-render="quantity">2</td>
            <td data-render="price" format="currency">R$200</td>
        </tr>
    </table>

produces:

    <div>
        Checkout page for Carlos Fernando,
        rendered at 2016-06-30 16:49:23
        <br/>

        Total Price: R$500
    </div>

    <table>
        <tr><td>Name</td><td>Quantity</td><td>Unit Price</td></tr>
        <tr>
            <td>Item 01</td>
            <td>R$100</td>
            <td>1</td>
        </tr>
        <tr>
            <td>Item 02</td>
            <td>R$200</td>
            <td>2</td>
        </tr>
    </table>



=head2 TEMPLATE INCLUSION

=head2 ELEMENT REMOVAL

=head2 ATTRIBUTE REFERENCE

=head1 CUSTOM HANDLER
