March 2009 Archives

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>, { $_ }
                }
            }
        }
    }
}

About this Archive

This page is an archive of entries from March 2009 listed from newest to oldest.

January 2009 is the previous archive.

April 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.32-en