I'm participating in the web framework for Perl 6 grant from The Perl Foundation. My first task has been working on a Tags library for (X)HTML generation.
I've got the start of a simple port of Template Declare implemented. It's not perfect, and I'm still working out the API we want, but it's functional, and nice. It's quite a bit nicer than CGI.pm-style html generation.
The philosophy of this library is that templates are code, and we should be able to deal with them as such. If your template is Perl, you can use all of the same tools you use for Perl. No need to learn a new language, and far fewer angle brackets. :)
Here's an example that runs under the current Tags.pm. Keep in mind, there's still a decent amount of API refactoring needed.
use Tags;
say show {
html {
head { title { 'Tags Demo' } }
body {
outs "hi";
ul :id<numberlist> {
outs "A list from one to ten:";
for 1..10 {
li :class<number>, { $_ }
}
}
}
}
}
