vishi83 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Great Ppl !!

Jus wanted to clarify my doubt. I thought of using perltidy for my scripts to check and clean up my PERL scripts.. Also another good option would be using checkstyle.. But my question to you ppl is :

Is there any such sort of programs for HTML Templates.. Anything that can check for badstyle of html templates like wat perltidy and checkstyle does for our perl scripts.

Thanks and awaiting you reply,


Replies are listed 'Best First'.
Re: Checkstyle For HTML Templates
by Corion (Pope) on Oct 22, 2005 at 13:29 UTC

    You mean, like html tidy (on Sourceforge and the original page, also on CPAN)? It doesn't work for HTML templates, but it works for the output generated by your templates. Well, actually, it works for a certain kind of HTML Templates, namely those used by Petal. If you're using a different templating system, you will need to check the output. But you want to do that anyway, as invalid input to your templates can generate invalid output.

      If you use HTML::Template you can use template tags in the form of HTML comments.

      <!-- TMPL_VAR NAME=PARAM1 -->

      This would allow you to validate the template.

        Well, not everything:

        <div class="<!-- TMPL_VAR NAME=PARAM2 -->">Test</div>

        Comment tags will validate as long as they are used outside of HTML tags.