On Mon, Jun 18, 2001 at 08:46:49AM -0400, Richard Chen wrote: > The html version of the installed manual page such as > http://localhost/tt2/docs/Manual/Intro.html > do not preserve literal [% ... %] constructs. > For example, instead of the correct illustration line like > > Dear [% tt_start_tag %] name [% tt_end_tag %], > > it shows the line > Dear name,
I'm confused. I've checked the docs in the latest version (2.03) and they do seem to generate the correct code. For example: http://www.tt2.org/docs/default/Manual/Intro.html where the output is correctly generated as: <pre>Dear <b>[% name %]</b>,</pre> from the template (in my case) /usr/local/tt2/docs/src/Manual/Intro.html <pre>Dear [% tt_start_tag %] name [% tt_end_tag %],</pre> > This makes these web version of the manual pages very confusing. Are you sure you're reading the generated output and not the source? Or do you have the generated HTML output overwriting the source templates? > But after some searching of the docs I could not find such an > equivalent in tt2. Simply doing \[%...%\] or \[\%...%] did not work. Hmmm yes, that probably should be documented somewhere. You can do this: [% tt_start_tag = "[\%" tt_end_tag = "%\]" %] and then: [% tt_start_tag %] INCLUDE foo [% tt_end_tag %] The script that builds the TT docs does this: my $tt2 = Template->new({ FILTERS => { tt_tags => \&tt_tags, } }); sub tt_tags { my $text = shift; for ($text) { s/\[%/[% START_TAG %]/g; s/(?<!\[% START_TAG )%\]/[% tt_end_tag %]/g; s/\[% START_TAG %\]/[% tt_start_tag %]/g; } return $text; } You can then do things like this: [% TAGS star %] [* FILTER tt_tags *] Blah blah blah [% INCLUDE foo %] Blah blah blah [% INCLUDE bar %] [* END *] which get converted to: Blah blah blah [% tt_start_tag %] INCLUDE foo [% tt_end_tag %] Blah blah blah [% tt_start_tag %] INCLUDE bar [% tt_end_tag %] HTH A -- Andy Wardley <[EMAIL PROTECTED]> Signature regenerating. Please remain seated. <[EMAIL PROTECTED]> For a good time: http://www.kfs.org/~abw/
