[parenscript-devel] PS-HTML (Was: this.bgcolor)

Daniel Gackle danielgackle at gmail.com
Mon Jun 21 06:39:57 UTC 2010


PS-HTML is indeed what I wanted, or almost (see below). I'm glad this
discussion came up. By the way, the documentation page you linked
to, which I hadn't looked at in a long time, is very nice.

I pushed two small patches to the repository to make PS-HTML do
what we need:

1. Use the string-buffer-join technique for concatenating HTML at
runtime, since the + operator is notoriously slow when the strings
aren't small, at least in older browsers.

2. Expanded the amount of compile-time constant folding of strings
that PS-HTML is able to do. For example, if you give it a character,
or an expression that macroexpands to a string, these are now joined
in with the string literals PS-HTML emits. Apart from reducing the
amount of joining needed at runtime, this makes the emitted HTML
more readable.

If either of these strikes anyone as inappropriate, speak up so we
can figure it out together.

I'm glad we had this discussion. I did not want to write yet another
sexp-html library.

Daniel



On Sun, Jun 20, 2010 at 1:41 PM, Daniel Gackle <danielgackle at gmail.com>wrote:

> <Or am I being dumb and you're talking about something else? >
>
> Not at all, I forgot about it. I think it didn't do what I wanted way
> back when, but I'll check it out again and report back. Thanks for
> reminding me.
>
> Dan
>
>
> On Sun, Jun 20, 2010 at 11:56 AM, Vladimir Sedach <vsedach at gmail.com>wrote:
>
>> Parenscript has always had an s-expr HTML markup generator
>> (
>> http://common-lisp.net/project/parenscript/reference.html#ssection-html-gen
>> ).
>> Or am I being dumb and you're talking about something else?
>>
>> Vladimir
>>
>>
>> 2010/6/20 Daniel Gackle <danielgackle at gmail.com>:
>> > If I understand correctly, your problem is that you want to express
>> > HTML in sexprs à la CL-WHO but with inlined PS expressions
>> > to dynamically change what gets emitted. Since you want PS
>> > expressions, you must be generating this HTML at runtime in
>> > the browser. Is that right?
>> > It so happens that I got frustrated with doing the same thing
>> > yesterday and wrote a macro to allow me to inline HTML inside
>> > PS in this way. Before I post it, though, I want to make sure it
>> > at least covers all our existing cases.
>> > Can other people pipe up and explain what they do to generate
>> > HTML from PS? Is there currently a standard solution better than
>> > "<div>"+blah+"</div>"?
>> > Daniel
>> >
>> > 2010/6/20 Haris Bogdanović <fbogdanovic at xnet.hr>
>> >>
>> >> Hi.
>> >>
>> >> How to set bgcolor within td tag (cl-who):
>> >>
>> >> (:td (ps (setf bgcolor "blue")))
>> >>
>> >> or something like this to get
>> >>
>> >> this.bgcolor="blue"      ?
>> >>
>> >> Thanks
>> >> _______________________________________________
>> >> parenscript-devel mailing list
>> >> parenscript-devel at common-lisp.net
>> >> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>> >>
>> >
>> >
>> > _______________________________________________
>> > parenscript-devel mailing list
>> > parenscript-devel at common-lisp.net
>> > http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>> >
>> >
>>
>> _______________________________________________
>> parenscript-devel mailing list
>> parenscript-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20100621/2d9593dc/attachment.html>


More information about the parenscript-devel mailing list