On Wed, Jan 23, 2002 at 09:01:43PM -0500, David B. Bitton wrote:
> 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.

s/dst/dest/g;

> I think I'm starting to understand.  The lib is the INCLUDE_PATH
> directive.  

Yep.

> You pre_process the config file as a "header" before each page.

Yep.

> 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.

Yep.

> As for the wrapper line,
> are all the items (WRAPPER page; PROCESS $template; END ) all reserved
> words that have a special meaning?

Yep, WRAPPER, PROCESS and END are all reserved keywords.  'template' is a
reserved variable which references the current template you're processing.
'page' is just the name of a template file (in lib) but it could just have
easily been 'my/fancy/page.html', for example.

The 'process' option in the .ttreerc tells TT to process this file instead
of the main template.  This file then processes the template (note the 
leading '$' to indicate the variable template, not the file called 'template')
and wraps it up in another template called 'page' which probably looks 
something like:

   <html>
   <head>...</head>
   <body>
   [% content %]
   </body>
   </html>

Here 'content' is a reserved variable which resolves to everything between
the [% WRAPPER xxx %] and [% END %], which in this case is the output of
processing the source template, [% PROCESS $template %].

> Also, the wrapper file, what is the file extension, or doesn't it have one?

TT doesn't do any file extension magic.  You can say [% INCLUDE foo %]
or [% INCLUDE foo.html %] but either way, it's just a filename which TT
applies as-is.

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

I think you are!  :-)

> Then I run ttree like
>
>  ttree -r -p

Alternately, you can put the following in your .ttreerc:

  recurse
  preserve

which then have the same affect as the -r and -p command line options.

A



Reply via email to