Loading ...
Sorry, an error occurred while loading the content.

external filter program or expressing

Expand Messages
  • Ken Perl
    Below is a sample of the html code processed by perl s Template.pm, I will use vim and want to ident lots of unident codes more smartly, just like external
    Message 1 of 1 , Apr 2, 2006
    • 0 Attachment
      Below is a sample of the html code processed by perl's Template.pm, I
      will use vim and want to ident lots of unident codes more smartly,
      just like external filter program perltidy or html indenting program
      tidy, or set any expressing to indent the codes?
      my problems are
      1) I don't know if there is any this kind of program for template toolkit tidy?
      2) if using expressing, I have no idea how to start, any docs?
      I read the doc |indent-expression| but I still can't write my own
      expression for the template toolkit.

      [% FOREACH section = menu %]
      <a href="[% root %]/[% section %]/index.html">[% section %]</a>
      [% END %]

      <b>Client</a>: [% client.name %] (id: [% client.id %])

      [% IF shopcart.nitems %]
      Your shopping cart contains the following items:
      <ul>
      [% FOREACH item = shopcart.contents %]
      <li>[% item.name %] : [% item.qty %] @ [% item.price %]
      [% END %]
      </ul>

      [% checkout(shopcart.total) %]

      [% ELSE %]
      No items currently in shopping cart.
      [% END %]

      --
      perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
      ")'
    Your message has been successfully submitted and would be delivered to recipients shortly.