Genereret: 8. Juni 2001, 08:49:46 | Copyright © 2000, Kurt Nørmark | ![]() |
It soon became clear that this ad hoc approach was inappropriate - and almost never ending. Therefore I generated a set of functions given a list of single tags and a list of double tags. This is the html-v1.scm library (manual)
In the meantime it became clear that these functions can be used directly when we write static HTML files. Thus instaed of using HTML or XML directly, we use the Scheme mirror functions. (Of course many people use WYSIWYG editors, but these are complicted in their own sense, and you are not in 100% control. These are not for programmers...) Thus, instead of writing:
<point> A text with a <a href="subsection/sec1.html">link</a> to a <b>subsection</b> </point>
we write something like
(point "A text with a " (a "link" 'href "subsection/sec.html") " to a " (b "subsection"))
Point is not a standard tag, but a tag we have programmed in Scheme. For people who like Lisp this is great. We are able to make and use our own tags, just like in XML. All the functions corresponding to HTML tags are part of the LAML libraries. By executing the Scheme program we return a text in pure HTML. Such a transformation is, by the way, also what happens on most XML documents today, by means of XSL for instance. Using Scheme we do not need grammars or DTDs. We are free to form the abstractions we like, and it is very easy and straightforward for a trained Lisp programmer. We can mirror XML as closely as we want or need. We can also just form the abstraction we find most attractive.
Now, the road is clear for definition of LAML styles for various document styles. I have made a variety of such styles for various purposes, such as course notes and home pages. The manuals referred above is also written using an LAML style. In fact, the manuals are extracted from 'doc comments' in Scheme programs, and as such made 'automatically'. And this file is written in LAML, of course. I never write a plain HTML file anymore. By the way, I wrote a simple article style in less than half a day mirroring the few LaTeX commands I use in my papers. This style is not yet released...
The main advantages of using LAML and Scheme instead of HTML/XML are the following:
Good so far. But there is a problem, namely the fact that all text have to be strings within string quotes. In practice, you will need to pass many small strings to HTML mirror functions or your own functions. It turns out the we can alleviate the problem of writing such strings via good editor support. First, just write the string without markup. After that apply the markup using a special editor command called embed, which splits the string in parts, and embeds the selected string into a Lisp function calling form. If needed, the embed function can also take care of surrounding string concatenation. We have implemented such as an editor command for the Emacs text editor. We have used the command heavily on this document, for instance. It turns out the when using such an editor command during the document creation process you almost never experience errors due to malformed Lisp expressions in your document.
It has become clear that the html.scm and html-v1.scm libraries are not good enough as the basic mirror of HTML in Scheme. Therefore we made a new foundation for LAML, which is based on a parsed HTML (version 4, loose) DTD:
The basic, surface and convenience libraries have now replace the earlier HTML mirrors, and all new LAML development should be based of them.
If you are a Lisp programmer I am confident that you also will enjoy making HTML and XML-like work in Scheme. There are other programmatic alternatives around than Scheme, typically based on functional langauges with emphasis on strong typing. Types can be used to ensure grammatical correctness of your documents. I feel the LAML work is more pragmatic or more flexible. This boils down to Lisp vs. languages in the more theoretical areas of Computer Science.
For further information you can consult the slides on LAML or the papers I have written, see the LAML Home page.
Kurt Nørmark
Aalborg University
normark@cs.auc.dk
Generated: 8. Juni 2001, 08:49:46