Plosurin - Perl implementation of Closure Templates

What is this ?

This is a template system for both client and server side.

More ...

It support:

  • Convert .soy files to Perl 5 code
  • Support web mode for quick UI mockup

Source code

Perl 5

In early development stage: http://github.com/zag/p5-plosurin

Perl 6

Experimental: http://github.com/zag/plosurin

Usage for Perl 5

Have template example.soy with content:

 
    {namespace mytest}
    
    /**
      * Simple test
     */
    {template .Hello}
    <h1>Foreach example</h1>
    {foreach $a in [1,2]}
        <p>Line: {$a}</p><br/>
    {/foreach}
    <p>Ok</p>
    {/template}
    

To get Perl 5 module (MyApp, for example), just run the following command:

 
        plosurin.p5 -package MyApp < example.soy > MyApp.pm
    

Use template in your Perl 5 program:

 
        use MyApp;
        print &MyApp::mytest_Hello();
    

or get help:

 
         perldoc MyApp.pm