Dear folks,
After one and half document reading and web search I can't figure
out how to include all files from a directory relative to the
main template.
Directory structure is like
/usr/local/lib/templates/foo/version1/-+-main.tt
|
+-features/-+-bar
|
+-baz
Template processor is called with INCLUDE_PATH="/usr/local/lib/templates",
and the template to process is called as "foo/version1/main.tt".
I should find a way to include all files under features
directory but their number and name is not known in advance.
With hardcoded absolute paths in main.tt I could do it:
[% USE dir = Directory('/usr/local/lib/templates/foo/version1/features') %]
[% FOREACH file = dir.files %]
[% PROCESS "/usr/local/lib/templates/foo/version1/features/$file.name" %]
[% END %]
But this is not acceptable. Include path most relative to the directory
containing main.tt not depending on its absolute location.
Any hint will be appreciated. (As well as strictly checked. :)
Gabor
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates