From edi at agharta.de Thu Jun 9 08:44:29 2005 From: edi at agharta.de (Edi Weitz) Date: Thu, 09 Jun 2005 10:44:29 +0200 Subject: [html-template-devel] Re: Concerning TBNL and HTML-TEMPLATE In-Reply-To: <42A78374.1080308@albany.edu> (Dan Larkin's message of "Wed, 08 Jun 2005 19:47:00 -0400") References: <42A78374.1080308@albany.edu> Message-ID: Hi Dan! Please use the mailing lists for future questions like these - see Cc and the links on the websites. Thanks. On Wed, 08 Jun 2005 19:47:00 -0400, Dan Larkin wrote: > First of all let me thank you for your terrific software. The > availability of your software (and others too) has really helped > my picking up lisp. You're welcome... :) > For the past few days I've been reading c.l.l (but not posting, > because I don't know nearly enough to participate in any of the > current discussions). My background with lisp began this winter > when I started a course at my University in scheme. Since then > I've been trying to get going with common lisp and web > programming (since that is what I do during the summer at my > job). Good luck! I'm sure you'll have fun with CL. > But anyway, on to my question: How can I get a template parsed > with html-template to come up with as a tbnl page? I'm working > off the tbnl-test example so I have just created a new function > add-artist' and added it to dispatch table, but I can't figure out > how to get it to output the results of parsing a template. Something like (defun add-artist () (with-output-to-string (*default-template-output*) (fill-and-print-template template/printer values))) should do it. Note that FILL-AND-PRINT-TEMPLATE prints its output to the stream *DEFAULT-TEMPLATE-OUTPUT* and TBNL wants a string returned by the handler, so the code above makes sure everything printed to this stream ends up in a string which is returned by the function. This assumes that ADD-ARTIST is a handler, not a dispatcher. > Also another issue I am having is get-parameters, get-parameter, > post-parameters and post-parameter all don't seem to work. Even > with something like > (defun add-artist () > (with-html > (:html > (get-parameters)))) > does not work (the way I'd expect it to at least, it produces only > the prologue and even when passed parameters). WITH-HTML is the macro which uses CL-WHO from the test suite, right? If that's the case you must wrap the form (GET-PARAMETERS) with something that asks CL-WHO to include it in the output, otherwise it'll only be evaluated for its side effects. One of (str (get-parameters)) (esc (get-parameters)) (fmt "~S" (get-parameters)) should do it. Does that help? Cheers, Edi. From edi at agharta.de Thu Jun 9 10:36:59 2005 From: edi at agharta.de (Edi Weitz) Date: Thu, 09 Jun 2005 12:36:59 +0200 Subject: [html-template-devel] New version 0.2.0 Message-ID: ChangeLog: Version 0.2.0 2005-06-09 Added :DO-NOT-CACHE option to CREATE-TEMPLATE-PRINTER Added clever DEFMETHOD trick by Peter Seibel Fixed bug in READ-UNTIL which doesn't affect HTML-TEMPLATE Better example in docs inspired by Bruce R. Lewis' critique on lisp-web Mention asdf-install in docs Added hyperdoc support Added :HTML-TEMPLATE to *FEATURES* Download: And you thought the project was dead, right? :) Cheers, Edi.