[Catalyst] App::TemplateServer
Jonathan Rockway
jon at jrock.us
Fri Jan 18 08:53:39 GMT 2008
Hi all,
A while ago, ranguard++ on IRC said it might be nice to have an
application that could take HTML templates (TT, etc.) and render them
with a set of static data. The idea is that you can give a small app
and templates to your non-Perl-developer web designer, and and s/he can
work on them offline without needing the full Cat app or a dev server
(or Perl skills, etc.)
Well, I wrote this application and it's on the CPAN as
App::TemplateServer. You run it like:
template-server --docroot /path/to/templates \
--docroot /more/templates \
--data preconfigured_data.yml
Then you point your browser to http://localhost:4000/ and enjoy the
templates!
By default, TT is used, but you can install other "Providers" which let
you use other templating systems. Mason and HTML::Template are on CPAN
right now (App::TemplateServer::Provider::*). TD is there too, but it's
broken (agent_zh++ and I are working on that...) Writing your own is a
small matter of implementing a single function, so there's no excuse to
not upload a driver for your favorite templating system right now :)
The other use I envision is experimenting with templating systems. Say
you hear a talk about TD and want to try it out? Now you can write the
template and see it instantly... no writing driver code, no making a
test Catalyst app, etc. Enjoyable!
BTW, the module I use for generating mock objects from a YAML file
(Package::FromData) might be useful for testing. Check it out.
Any feedback is welcome.
Regards,
Jonathan Rockway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080118/cf4a2c92/attachment.pgp
More information about the Catalyst
mailing list