> At 05:58 PM 01/23/02 -0500, David B. Bitton wrote:
>>I have been using TT2 in code for a while now, but I've never tried
>>TTree before.  I am confused by the documentation.  How does it process
>>a whole file tree?  What do I have to do to my templates to make then
>>TTree ready?
>
> Not much.
>
> You set up a .ttreerc file in $HOME.  it has a line like
>
>  src = /home/moseley/tt/websrc
>  dst = /home/moseley/public_html
>  lib = /home/moseley/tt/ttlib
>  copy   = \.(gif|png|jpg|jpeg|pdf|zip|txt|doc|pm)$
>  pre_process = config
>  process = wrapper
>
> The src says where the source templates are located, and the dst is the
> output location.  Use config to set variables for use in the templates.
>
> I use "wrapper" to create my pages which is basically:
>
>   [%- WRAPPER page; PROCESS $template; END -%]

I think I'm starting to understand.  The lib is the INCLUDE_PATH
directive.  You pre_process the config file as a "header" before each
page.  Then ttree moves recursively through each file, pulls in the
necessary additional files from the library, processes then, and outputs a
processed page (same name?) into the dest dir.  As for the wrapper line,
are all the items (WRAPPER page; PROCESS $template; END ) all reserved
words that have a special meaning?  Also, the wrapper file, what is the
file extension, or doesn't it have one?

Otherwise, it looks like I'm on the path to enlightenment!

>
> Then I run ttree like
>
>  ttree -r -p
>
>
>>Also, in the demos, the INCLUDE directives do not have a file
>>extension, so the say INCLUDE foo not INCLUDE foo.bar.  Is there a
>>default extension for a template?
>
> No, I don't think so.
>
>>My objective is the create templates that would comprise
>>an entire site.  Then symlink up an image dir (or somehow loop through
>>a number of them, perhaps piping the ouput of an ls to TTree via
>>xargs), and churn full sites from them.
>
> I just build the entire site under my websrc directory and let ttree
> build the templates and copy the images and other related files as
> needed.  Works nicely for simple mostly static sites.
>
>
> --
> Bill Moseley
> mailto:[EMAIL PROTECTED]
>
> _______________________________________________
> templates mailing list
> [EMAIL PROTECTED]
> http://www.template-toolkit.org/mailman/listinfo/templates



--
David B. Bitton
[EMAIL PROTECTED]

Diversa ab illis virtute valemus.




Reply via email to