The Project Definition File is used to manage all information related to a specific Project. It is
conceptually similar to a "make file" used by many programming languages. In addition to listing all
of the HTML Documents in a Project, the Project Definition File also describes the inheritance
hierarchy of Content Files and Macros.
The format of the Project Definition File is as follows:
The description above is a generalized template for the Project Definition File.
Since many of the files in this template are optional, an actual Project Definition File will be
much more concise. Here is an example of a Project Definition File for a simple
# This is a comment
- Global Content Files are defined by placing "Globals=" on the start of a line at the top of the file.
The Macros in these Content Files are global in scope and can be referenced by any Template or Content File in the Project.
- Folders are defined by placing the name of a folder between brackets (i.e. [FolderName])
on its own line. In the example above, the Folders "Index" and "Chapters" are defined. (Note: Webgenz Folders have no direct relationship with Windows Folders.
However, you may decide to structure your Project so that they do. Webgenz Folders are simply a mechanism that allows you to logically
divide a Project into sections).
- Folder Content Files are defined by placing "Globals=" on the start of a line right after a Folder definition.
The Macros defined in Folder Content Files have a scope that is limited to the Folder where they are defined. In
other words, the Macros in Folder Content Files can be referenced by any Templates or Content Files defined within the Folder.
- Documents listed under a Folder are defined as follows:
where TemplateFile, and ContentFile1 thru ContentFileN are optional.
You may list as many Content Files as you wish for each Document. The Macros defined in these Content Files are specific
to the Document defined on the same line. The Macros in these files have a "local" scope.
- Inheritance Hierarchy - The basic functionality of Webgenz is to generate Documents from Templates and Content Files. During this Document generation
process Webgenz replaces Macro references with the definitions of those Macros. As Webgenz searches for a Macro definition it
will search Content Files in a specific order. The order that Webgenz searches Content Files is determined by the inheritance
hierarchy. The inheritance hierarchy of Content Files is as follows:
Project Macro File (if one has been defined)
Note: You can define a single Project Macro File in the "Advanced" tab of the "Project Properties" screen. The
Macros defined in the Project Macro File will take precedence over Macros defined in all other Content Files.
When Webgenz searches for a Macro Definition, it begins by searching the more specific Content Files and then
continues searching the more general Content Files until the Macro Definition is found. As soon as Webgenz finds the Macro
definition, it stops searching.
Additional notes on format of the Project Definition File:
Here's a sample of a Project Definition File:
- Blank lines in the file are ignored.
- Spaces before or after a file name are ignored.
- Each Document line ends with "!".
- Comments are added to the file by including "#" at the start of a line.
- The end of a Project can be specified by including "!" at the start of a line.
- The files used in a Project cannot contain the "!" character in their names.
- The general convention is that Templates use the ".tpl" extension and
Content Files use the ".par" extension. However, you may use any naming convention you wish.