| Frank Buss 2005-05-28, 8:57 pm |
| I want to transform my HTML pages to Lisp, because then I don't have to
write as much as with raw HTML, the compiler can check missing closing
tags, I can execute Lisp code for generating parts of the page etc. But I
don't want to use double-quotes for every text, because text is the
normal case. I hope this is possible with a reader-macro, perhaps it
could look like this:
#h ((head
(title "A Test"))
(body
(p Just a (bold test).(br)
1 + 2 = (+ 1 2).(br)
And a link: (a :href "page.html" The Page).)))
If the first word is a known HTML tag, then the next words are
interpreted as ":key value" pairs for HTML attributes and the rest is
text. If the first word is not a HTML tag, it is evaluated as a Lisp
form. The result:
<html>
<head>
<title>A Test</title>
</head>
<body>
<p>
Just a <b>test</b>.<br>
1 + 2 = 3.<br>
And a link: <a href="page.html">The Page</a>.
</p>
</body>
</html>
Do you think this is a good idea? How do I implement it? Normally all
characters are changed to uppercase with read.
--
Frank Buß, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
|