Mistie

Dorai Sitaram
Download mistie.tar.gz!

Knowne vnto these, and to my selfe disguisde:
Ile say as they say, and perseuer so:
And in this mist at all aduentures go.
(The Comedy of Errors, II.ii)

Mistie is a programmable filter. Its primary aim is to let the user define a document's markup using Scheme.

By itself, Mistie does not require any style of markup or format of either its input or its output. It simply copies its standard input to standard output as is. E.g.,

mistie.scm < input.doc > output.doc

produces an output.doc that is indistinguishable from input.doc. mistie.scm can be given a file's name as argument, in which case it reads that file instead of standard input. Thus, the above command is equivalent to

mistie.scm input.doc > output.doc

To make Mistie do something more interesting than copying input verbatim to output, the user must supply a format file. A format file is a Scheme file that describes the markup of the input document in terms of the desired output format. Format files are specified with the -f option. E.g.,

mistie.scm -f myformat.mistie < input.doc

produces a formatted version of input.doc, the formatting being dictated by the format file myformat.mistie. The formatted version may either go to standard output or to some file depending on myformat.mistie. We will use the .mistie extension for Scheme files used as format files, but this is just a convention.

In general, a format file will use the Mistie infrastructure to define a particular markup, deciding both what the input document should look like and what kind of output to emit. Format authors are not limited to a specialized sublanguage -- they can use full Scheme, including all the nonstandard features of the particular Scheme dialect they have at their disposal.

Writing a format file requires some Scheme programming skill. If you're already a Scheme programmer, you are all set. If not, you can rely on format files written by people whose taste you trust. If it helps, Mistie is somewhat like TeX in its mode of operation (though not in its domain), with the ``macro'' language being Scheme. The analogy is not perfect though: There are no predefined primitives (everything must be supplied via a format file), and the output style is CFD (completely format dependent) rather than some DVI (device independent). (Hope that wasn't too mistie-rious.)

The distribution includes several sample format files: Format files may be combined in the call to mistie.scm, e.g.,

mistie.scm -f plain.mistie -f footnote.mistie file.doc > file.html
mistie.scm -f plain.mistie -f multipage.mistie file.doc

Alternatively, a new combination format file can be written that loads other format files. E.g., the following format file basic.mistie combines within itself the effects of plain.mistie, scmhilit.mistie, and multipage.mistie:

; File: basic.mistie

(load-relative "plain.mistie") ;or use `load' with full pathnames
(load-relative "scmhilit.mistie")
(load-relative "multipage.mistie")

It is invoked in the usual manner:

mistie.scm -f basic.mistie file.doc

Note that the format file multipage.mistie creates a set of .html files whose names are based on the name of the input document. Therefore, when using this format file, whether explicitly or implicitly, redirection of standard input or standard output is inappropriate.

The name Mistie stands for Markup In Scheme That Is Extensible. Possible pronunciations are miss-tea and miss-tie.

Last modified: Dec. 5, 1999