Template::Plugin::NakedBody and Perl::Squish!

Alias on 2005-05-25T09:43:39

Now really, how could anybody resist a headline like that!

In my periodic quest to make the editing of Template Toolkit templates simple for "designers" and sane for the rest of us, I decided I wanted to be able to have included fragments of pages properly editable by designers, with full stylesheets and everything.

And I wanted to do it without having having ugly <!-- [% -->header<!-- %] --> having to be dumped all over the place.

Template::Plugin::NakedBody is a filter which you use like [% INCLUDE page_fragment.html | NakedBody %] and which strips away the header gumph leaving only the raw body.

Time will tell if adding | NakedBody to each include is more maintainable than adding tags to each fragment, but at least designers are WAY less likely to break the filter calls as they go about their work.

I've also written up a Perl.com article for the 9th of June demonstrating a basic use of PPI. The module that accompanies the talk, Perl::Squish, should be up on CPAN shortly.