home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / comms_networking / zonk / rawdocs / dlay < prev    next >
Encoding:
Text File  |  1999-02-13  |  4.6 KB  |  69 lines

  1. $zonkpage 1.07
  2.  
  3. $usetemplate: tpl.cmd/tpl
  4.  
  5. title: Datafile layout
  6.  
  7. text:{<sh>Header line</sh>
  8. The first line of any Zonk datafile must be a header line as described in <ref genc>general concepts</r>.
  9.  
  10. <sh>Variable definitions</sh>
  11.  
  12. A variable definition takes the general form:
  13.  
  14. <lit><var>name</var>: <var>value</var></lit> 
  15.  
  16. The <var>name</var> must be alphanumeric whereas the <var>value</var> can contain any characters.
  17.  
  18. e.g.
  19.  
  20. <lit>iam: Tim Brown</lit> 
  21.  
  22. Here the variable name is "iam" and the variable value is "Tim Brown". Any whitespace following the colon is ignored and the value ends at the linend. If you want a value to include whitespace and/or linends use braces {} thus:
  23.  
  24. <lit>youare:{  this is 
  25. your name
  26. </lit><lit>}</lit> 
  27.  
  28. Here the variable name is "youare" and the value is "  this is[cr]your name[cr]" where the value contains embedded newline characters represented on this page as [cr]. The opening brace must immediately follow the colon and the closing brace must appear on a line of its own in column one. This is one of the few places where Zonk is very strict about where you can and can't have whitespace. If there is no closing brace the definition continues to the end of file, but Zonk will give you a warning about this.
  29.  
  30. Variables can have more than one definition, consider:
  31.  
  32. <lit>town: London
  33.  
  34. town: Birmingham
  35.  
  36. town: Manchester</lit> 
  37.  
  38. In this case the variable "town" has three values and is said to be "<ref genc>dynamic</r>". Initially the value which will be accessible in the template will be the first one, "London", but Zonk provides various commands to access the other values and can loop around parts of the template dependent on the number of values supplied.
  39.  
  40.  
  41. Generally definitions like these will be contained in the datafile that you submit to Zonk for processing and the definitions only exist while that particular file is being done. However it can be useful to have definitions which span a whole set of files or even are constant for your particular environment. This is where the <ref sconf>'system' and 'global'</r> configuration files come in.
  42.  
  43.  
  44. <sh>Datafile directives</sh>
  45.  
  46. As well as variable assignments there are a few directives which may be included in a datafile. Provided your configuration file is set up correctly none of these have to be included to make Zonk work however they give added flexiblity. All directives start with a '<lit>$</lit>'.
  47.  
  48.  
  49. <lit>$</lit><lit>endpage:</lit> 
  50.  
  51. This directive is used to split up the datafile so that it generates several html pages. When it is reached, Zonk stops reading the datafile and uses the template to produce an output page with the variables supplied up to that point. When the output page is finished Zonk discards any <ref genc>dynamic</r> variables and reads in the new definitions up to the next <lit>$</lit><lit>endpage:</lit> (or end of file) then re-uses the template to produce a second output file and so on.
  52.  
  53. <lit>$template: <var>template filename</var></lit> 
  54.  
  55. Zonk's configuration file can be set up to determine the template to use based on the name of the datafile. Using this directive you can override any configuration file settings and use a template of your choice.
  56.  
  57. The <var>template filename</var> can either be an absolute one or relative to the datafile. However if you use a relative path then you must have your current directory set correctly. You may also include a '<ref wild>wild date</r>' part in the template name if you wish. This enables you to use a different template based on some aspect of a date. See the <ref wild>relevant section</r> for more details.
  58.  
  59. <lit>$outputto: <var>output filename modifier</var></lit> 
  60.  
  61. As with the template choice the output file can be determined using the datafile name and configuration file settings. One of two special mappings is used depending on whether the datafile is to produce a single html page or multiple html pages (that is it includes at least one <lit>$</lit><lit>endpage:</lit>). For multiple pages then part of the filename consists of the page number. <lit>$outputto:</lit> does not override these mappings completely, what it does do is to apply the appropriate mapping to whatever you supply as the <var>output filename modifier</var> rather than the input filename.
  62.  
  63. <lit>$readlog: <var>Zonk user log filename</var></lit> 
  64.  
  65. Includes the contents <var>Zonk user log filename</var> as part of the variable definitions. See the section on <ref logs>logfiles</r> for more details.
  66.  
  67. <lit>$pullout: <var>html filename</var></lit> 
  68.  
  69. This processes the previously created <var>html filename</var> as a '$pullout file'. Again you should see the <ref pulo>relevant section</r> for more details.