Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Need a name for YATP (templating package)

by gam3 (Curate)
on Oct 22, 2006 at 14:39 UTC ( [id://579862]=perlquestion: print w/replies, xml ) Need Help??

gam3 has asked for the wisdom of the Perl Monks concerning the following question:

I am thinking of putting yet another template package on CPAN. I am planning to call it SST (super simple templates). But would like some advice on whether it should go in WWW or HTML.

I am open to any and all naming suggestions.

Why yatp? I wanted a package that seperates the web page design from the perl programming. The package that I am working on has two major features. The input template is valid HTML/XHTML. The program can test what data was displayed on the page.

An example

template
<span id="data1">This text will be replaced</span> <ul id="list1"> <li id="items">This will be replaced by each item</li> </ul>
The perl code:
my $t = WWw/HTML::SST->new('templatefilename'); print $t->output( data1 => $t->replace(text => 'new text), list1 => $t->loop( headers => ['items'], data => [['item1'], ['item2']], ), );
The output
<span id="data1">new text</span> <ul id="list1"> <li id="items.1">item1</li> <li id="items.2">item2</li> </ul>
-- gam3
A picture is worth a thousand words, but takes 200K.

Replies are listed 'Best First'.
Re: Need a name for YATP (templating package)
by davido (Cardinal) on Oct 22, 2006 at 16:47 UTC

    Personally, I wouldn't just happen to guess what SST stands for as I search CPAN for a templating package. Lets say that your module has three primary features:

    1. It outputs XHTML
    2. It's a templating utility.
    3. It's simple.

    So tell the world that in the package name:
    XHTML::Template::Simple

    That way when someone searches CPAN for XHTML and Template, they'll quickly understand what that module is for as they see it in the search results.


    Dave

      this post gets the "As simple and beautiful as the iPod" design award. Kudos davido++
      --

      when small people start casting long shadows, it is time to go to bed
Re: Need a name for YATP (templating package)
by jbert (Priest) on Oct 22, 2006 at 16:39 UTC
    Also looks a lot like Ruby's amrita.

    I was just looking around for a perl version of that the other day, so I'm glad you're writing one.

    Are you aware of Amrita? Do you have any design goals about compatability? It would be kind of cool if the same template could work with ruby or perl code.

    I've not followed the amrita dev closely, but I saw some remarks that they had re-worked things a bit after the the first version, so there might be some useful lessons learned to pick up.

    IMHO, it should go in HTML. It would be useful for manipulating HTML, irrespective of whether those pages were to be served via HTTP or made available to 'the web'. (Splitting hairs, I know, but hey.)

    I'd also call it Atirma or something like that, personally :-)

Re: Need a name for YATP (templating package)
by perrin (Chancellor) on Oct 22, 2006 at 16:01 UTC
    It looks a lot like Petal.
      Yes it does look alot like Petal. The problem with petal (at least for me) is that while petal templates are valid XML, they are not valid XHTML.
      <span tal:replace="my_var/hello_world">Hola, Mundo!</span>
      -- gam3
      A picture is worth a thousand words, but takes 200K.
        And this is worth writing a whole new system for? There's also Template::TAL and HTML::Seamstress, and there are undoudbtedly more pursuing this sort of approach.
Re: Need a name for YATP (templating package)
by wazoox (Prior) on Oct 22, 2006 at 20:40 UTC
    I very much like your templating system and am eager to try it from CPAN :) By the way, I support the excellent davido's suggestion of XHTML::Template::Simple.
Re: Need a name for YATP (templating package)
by castaway (Parson) on Oct 23, 2006 at 07:45 UTC
    AFAICA, "WWW::" is for modules which connect via HTTP to something and parse/use it.. e.g. WWW::Mechanise, WWW:Search etc. "HTML::" is for modules that produce or parse HTML, so I'll go with davidos suggestion too.

    C.

Re: Need a name for YATP (templating package)
by BUU (Prior) on Oct 22, 2006 at 19:45 UTC
    So is the point of the template to make it completely impossible to guess what the output is going to be, merely by exmaining the template?
      No! I think that is what CSS and JavaScript are for ;)
      -- gam3
      A picture is worth a thousand words, but takes 200K.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://579862]
Approved by Joost
Front-paged by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found