The input directory is converted into some tree like data structure in the obvious way. The file nodes are substituted with data structures from inside those files. This big structure can be edited by the user and then every node of type "file" processed with proper template.
The program uses Template Toolkit templates library. Because each node has links to the parent and root nodes the template can use the entire structure. For example the 'par' subnode is a link to the node created from the parent directory. So
[% par.file.title %]should evaluate to the title of article from file named "file" in the same directory. Elements that can be utilized in templates:
'par' - the parent directory of file being processed
'root' - the root directory
Additional elements present in nodes made from directories:
'texts' - selection of subnodes that are texts
One more example:
[% FOREACH x = par.subdir.texts %] [% x.value.title %] [% END %]
The output shoul be a list of titles of articles found in the subdirectory 'subdir' of current directory.
There are three rules:
Schemas are means for the administrator to define a list of possible structures for articles, and for supplying default data for them. The schemas are defined in the file named '_schema.dat' residing in the root source directory for the given project.