I guess I still haven't gotten the darcs post-apply hook right, because this morning I pushed out the change that made ps-html work in both Parenscript and CL. I also decided to get rid of CSS generation altogether; chief reason being I didn't like the code and didn't want to rewrite it, secondary reason being that right now it is not a good idea to futz around with CSS on the client side for performance reasons (which is why I didn't want to rewrite the code).
The one thing I didn't do was to provide CL-WHO like HTML markup. That will have to wait a little bit.
Vladimir
On Dec 6, 2007 7:15 PM, Gary King gwking@metabang.com wrote:
I've just started playing with Parenscript and feel confused about HTML generation. Since Parenscript already includes (the unexported) process-html-forms, it seems to be able to (almost) handle much of the logic for simple HTML generation. Consider that
(parenscript::process-html-forms `(:html (:head (:title "ParenScript tutorial: 1st example")) (:body (:h1 "ParenScript tutorial: 1st example") (:p "Please click the link below." :br ((:a :href "#" :onclick ,(ps-inline (alert "Hello World"))) "Hello World")))))
produces
(+ "<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>")
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.
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?
thanks,
Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel