Here's a short little tt2 snippet (nothing fancy)
tpage --define dirp=E:\dev\loose\ab --define tld=dirtree.com dirtr +ee2.tt2 >dirtree2.html
produces
<!-- Usage: tpage --define dirp=E:\dev\loose\ab --define tld=dirtree.com dirtr +ee2.tt2 >dirtree2.html --> <table border=1> <tr> <td bgcolor="white"> <base href="dirtree.com"><br> <a href="http://dirtree.com/">http://dirtree.com/</a><br> <blockquote> <font color="white">/</font><a href="/Qo">Qo</a> <br> <font color="white">/Qo/</font><a href="/Qo/ZZ">ZZ</a> <br> <font color="white">/Qo/</font><a href="/Qo/a">a</a> <br> <font color="white">/Qo/a/</font><a href="/Qo/a/s">s</a> <br> <font color="white">/</font><a href="/ro">ro</a> <br> <font color="white">/ro/</font><a href="/ro/ZZ">ZZ</a> <br> <font color="white">/ro/</font><a href="/ro/la">la</a> <br> </blockquote> </td> </tr> </table>
<!-- Usage: tpage --define dirp=E:\dev\loose\ab --define tld=dirtree.com dirtr +ee2.tt2 >dirtree2.html --> <table border=1> <tr> <td bgcolor="white"> [% USE dir = Directory(dirp) %] <base href="[% tld %]"> <a href="http://[% tld %]/">http://[% tld %]/</a><br> <blockquote> [% INCLUDE showdir %] </blockquote> </td> </tr> </table> [%- BLOCK showdir -%] [%- RETURN UNLESS dir.dirs -%] [%- FOREACH item = dir.dirs -%] <font color="white">[%- href -%]/</font><a href="[%- href -%]/[%- item +.name -%]">[%- item.name -%]</a> <br> [% newhref = "$href/" _ item.name %] [%- item.scan -%] [%- IF item.dirs -%] [%- INCLUDE showdir dir=item href=newhref %] [%- END -%] [%- END -%] [%- END -%]

Replies are listed 'Best First'.
•Re: dirtree2.tt2
by merlyn (Sage) on Jun 01, 2003 at 17:46 UTC
    You failed to URI-escape and then HTML-entitize the href attribute of the a tag. You also failed to HTML-entitize the same name in the link text. Please remember that a file named <blink> can ruin your day. {grin}

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: dirtree2.tt2
by PodMaster (Abbot) on Jun 01, 2003 at 16:34 UTC
    Here's the unordered list version
    <!-- Usage: tpage --define dirp=E:\dev\loose\ab --define tld=dirtree.com dirtr +ee2.tt2 >dirtree2.html --> <base href="http://[% tld %]/"> [% USE dir = Directory(dirp) %] <ul> <li> <a href="http://[% tld %]/">http://[% tld %]/</a> [% INCLUDE showdir %] </ul> [% BLOCK showdir -%] [%- RETURN UNLESS dir.dirs -%] <ul> [%- FOREACH item = dir.dirs -%] <li><a href="[%- href -%]/[%- item.name -%]">[%- item.name -%]</a> [% newhref = "$href/" _ item.name %] [%- item.scan -%] [%- IF item.dirs -%] [%- INCLUDE showdir dir=item href=newhref %] [%- END -%] [%- END -%] </ul> [% END %]


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.