I hope I understand what you want ... just to avoid actually typing the tags? Because if they are going to be in the outputted HTML file, they are going to get printed somehow, by somebody :-)

One thing to consider is that you can use TT2 to make TT2 templates ... So your default template for making an .html.tmpl could include the TT2 tags to display the debug info you want ...

Or, if you make your templates by hand, since the text strings are going to be at the top and bottom of every template file you have, it doesn't seem necessary for TT2 to magically insert them. Instead, you could have the lines pre-inserted in the actual text files you create for templates, for example by using a macro in vim:

# in ~/.vimrc " Set up templates for new files autocmd BufNewFile * 0r ~/.vim/templates/%:e.template

and then

# in ~/.vim/templates/tmpl.template <!-- Start output from [% component.name %] --> <!-- End output from [% component.name %] -->

and then whenever you open a new file in vim it will have the tags pre-inserted.

Hope this is close to the mark of what you needed!


In reply to Re^3: Template Toolkit - Output Template Name / Filepath as HTML Comment by 1nickt
in thread Template Toolkit - Output Template Name / Filepath as HTML Comment by cjoy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.