[parenscript-devel] Generating HTML in parenscript

Vladimir Sedach vsedach at gmail.com
Tue Dec 18 20:29:58 UTC 2007


Hello,

> It's easy to refactor process-html-forms to arrive at the (slightly
> incorrect) HTML in a string:
>
> > "<html/><head><title>ParenScript tutorial: 1st example</title></
> > head><body><h1>ParenScript tutorial: 1st example</h1><p>Please click
> > the link below.<br/><a href=\"#\" onclick=\"javascript:alert(\"Hello
> > World\")\">Hello World</a></p></body>"
>
>
> and probably easy to futz with *js-inline-string-delimiter* and the
> like to get the correct quotes around the body of the onclick handler.

The *js-inline-string-delimiter* is a bit of a hack right now. It
would be nice if I could figure out a way of automatically integrating
the ParenScript printer with different HTML output facilities to
choose the correct string delimiters.

> So... since Parenscript doesn't do this, I have to ask "Why not"?! It
> would be nice to use Parenscript for simple HTML generation without
> having to get (Portable) AServe or some other more full-featured HTML
> generator. Am I missing something?

I don't think you're missing anything Gary. It's pretty much a matter
of replacing "+" with "concatenate 'string."

On the other hand, the HTML generation really isn't core to
Parenscript (a few people have complained about it in the past), but
it does come in very useful. I don't think it's worth it to put it
into a separate project (there are much better tools like CL-WHO and
LML2 if you just want to generate HTML from Lisp). What I will
probably do is as you suggest and export that interface for those who
want to use the Parenscript HTML generation facility throughout for
something light-weight. If JavaScript came with streams built-in, what
I would probably do is make a wrapper for CL-WHO output.

Speaking of CL-WHO, would anyone object if I changed the syntax of the
Parenscript HTML markup to be like that of CL-WHO?

Thanks,
Vladimir



More information about the parenscript-devel mailing list