The format of source files

Lines of source-file text come in two flavours: ordinary lines which contain text and html markup, and code lines that begin with >  followed by a space. Code lines can be used for defining variables standing for strings. The values of variables can be used in ordinary lines by prefixing the variable name by a dollar sign, $, but only in lines which are prefixed by a minus-sign, -, (which does not appear in the resulting html). The use of the minus sign in this way avoids unnecessary processing of lines that do not need it. Code lines can appear anywhere. Only their relative ordering matters. In particular an ordinary line that uses a variable can precede the code line in which the variable is defined. See the source directory Doc_src of these web pages to see an example.
Two variables are built in:
  • TITLE
  • CSS
The value of TITLE is used to describe the link to the current page in the contents page. If it is not defined the name ?? appears. The value of CSS, if set, is the leaf name of the CSS file in the target-directory whose styles are used only by the current page. You must put such a file in the target-directory yourself.
Some functions that produce strings are built-in
  • URL
  • THISPATH
  • LI
  • EM
URL produces links. For example the code line
 > link = URL "http://riscosnews.wordpress.com" "RO News"
gives link the value
 <a href="http://riscosnews.wordpress.com>RO News<a>
LI produces list-items, EM emphasizes, THISPATH converts filenames relative to the target-directory into absolute filepaths. This is useful if your target-directory contains resources, such as databases, which your web-book needs to access. For example, if you have a database file of the form
 => { record1; ...  }
then the code-line
 > db = dofile (THISPATH db_file)
means that the n-th record is given by the expression db[n].