Script Processing Details
When a DynaDoc script is processed, the following sequence is employed.
- The first step is to determine whether a single script or list of scripts has been provided as input. If a list of scripts is provided, the following steps are repeated for each script.
- DynaDoc checks for a master text substitution file of the same name as the script, but with a ".sub" extension. If this file exists, it is processed.
- DynaDoc uses multiple passes to process the script:
- Pass 1: Scan through the script to process !INCLUDEs and compile a final complete script for processing,
- DynaDoc automatically includes a script preface and script suffix, named required/script_preface and required/script_preface. If these files exist, they are included in the script at the beginning and the end respectively.
- To override either of these scripts, add script_preface,<preface name> or script_suffix,<suffix name> to the master text substitution file, where <preface name> or <suffix name> is the name of the desired script preface or script suffix.
- To disable either of these scripts, add script_preface, or script_suffix, to the master text substitution file. Note that the "," must be included as part of the text substitution line definition.
- Pass 2: Process commands
- Pass 3: Process view menu and view table of contents
- Pass 4: Process print table of contents
- Pass 5: Process next page links
- Pass 6: Process page contents
- DynaDoc displays the script processing details.
This method of multipass processing has the following implications:
- In order to use a variable in an !INCLUDE (see below), the variable must be an existing DyanDoc variable, or must be defined in the master text substitution file.
- Page definitions can be included in any location. !INCLUDEs and commands will be processed before the page definitions are processed.
Using Text Substitution to Set and Recall Variables
Text substitution is essentially a method to set DynaDoc variables.
Defining a text substitution placeholder that matches a DynaDoc variable may have unintended results, including preventing DynaDoc from executing! tsub has been reserved and is not used as the start of a variable name. Text substitution placeholders can begin with tsub without fear of accidentally redefining a DynaDoc variable.
Text Substitutions that are used as variables can be accessed in the following ways:
In commands, as parameters using $<variableName> - substitutes the variableName's value
In !INCLUDEs using @@<variableName> - includes the file represented by the variableName's value
In <!--i--><!--/i--> using $$<variableName> - substitutes the variableName's value
In <!--i--><!--/i--> using @@<variableName> - includes the file represented by the variableName's value
|