in reply to Re: HTML::Seamstress - the Outsider
in thread RFC - Template::Empty

Just out of curiosity - what do you use when you need to send a templatized css file, or js file, or text email.
Well, that's a good question. I've never had to do those things. Part of your extra extra credit was to create a text version. And here it is:
package View::bullet::text; use base qw(View::bullet); use Data::Dumper; use HTML::FormatText; my $file = 'html/bullet.html'; sub new { __PACKAGE__->new_from_file($file); } sub render { my $tree = shift; my $model = shift; my $tree = $tree->SUPER::render($model); my $formatter = HTML::FormatText->new(leftmargin => 0, rightmargin = +> 80); my $text = $formatter->format($tree); return $text; } 1;
I have beheld the tarball of 22.1 on ftp.gnu.org with my own eyes. How can you say that there is no God in the Church of Emacs? -- David Kastrup
[tag://html,templating,seamstress,oop]
Enforce strict model-view separation in template engines via HTML::Seamstress The car is in the cdr, not the cdr in the car