Settings concerning compilation and publishing of projects are controlled by mlt.conf files. There will generally be two files that influence a particular project: a system-wide file (probably in /etc/mlt.conf) and the mlt.conf file in the project directory. Single-value option settings from the project configuration override the system-wide configuration when there is a conflict.
Files consist of a sequence of the following kinds of lines in any order:
- in directory: Treat directory as the project directory. This defaults to the current working directory.
- out directory: Use directory as the working directory. Among other things, a heap.x86-linux file will be placed here that must be readable by the web server that you intend to use. (If the server runs your CGI scripts as your user, like Apache does with suexec, then you probably don't need to worry about this.) This defaults to the current working directory.
- pub directory: Publish CGI scripts to directory. Each will be a sh shell script that runs SML/NJ with the generated heap.x86-linux and appropriate arguments. This defaults to the current working directory.
- lib file: file is the path to the .cm file for the mlt template library. This is the library built from the src/lib/ tree. It defaults to /usr/local/share/mlt/src/lib/sources.cm.
- compiler file: file is the path to the .cm file for the mlt compiler library. This is the library built from the src/ tree. It defaults to /usr/local/share/mlt/src/sources.cm.
- sml directory: directory is the path to the SML/NJ bin directory. It defaults to /usr/local/sml/bin.
- cm file: file is the path to a file that the SML/NJ Compilation Manager understands (i.e., .cm, .sml, .sig, .grm, .lex). This file is to be made available to templates in the project.
- print type = code: This declares that the given code is an SML expression that evaluates to an appropriate function for printing values of the SML type. The code should usually be the name of a function defined in a library or project SML source file.
- before template: Run template before every normally-requested template, including its output at the beginning of the final output. This can be used to set up project-wide global state. Performing initialization inside project SML files will not generally be good enough. This is because all of the structure definitions these contain are evaluated at ``compile time,'' causing their code not found inside function definitions to be run only once.
- after template: Run template after every successfully executing template, including its output at the end.
- exn template: Run template when an exception goes uncaught during normal template execution. The function Web.getExn : unit -> exn can be used to retrieve the causing exception from within template. The before and after templates are not run in the exn template when it is executed because of an uncaught exception.
Adam Chlipala
2005-02-22