<div dir="ltr">It printed out the surrounding "".<div><br></div><div style>I changed to write-string, and the chrome seems to handle it as correct html.</div><div style><br></div><div style>Thanks.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 30, 2013 at 2:03 PM, Jay McCarthy <span dir="ltr"><<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What's wrong with that output? Is that you want display and not write?<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Apr 30, 2013 at 12:00 PM, J G Cho <<a href="mailto:gcho@fundingmatters.com">gcho@fundingmatters.com</a>> wrote:<br>
> It seems like pages are built and saved to a table which looks like<br>
><br>
> '#hasheq((#<procedure:static-page><br>
> .<br>
> (html<br>
> (head (title "My CV"))<br>
> (body (p (a ((href "index.html")) "Dave Herman")))))<br>
> (#<procedure:static-page><br>
> .<br>
> (html<br>
> (head (title "My Web Site"))<br>
> (body (p "Check out my " (a ((href "cv.html")) "CV."))))))<br>
><br>
> Then the values of the above are written out.<br>
><br>
> Except in the code seems to "normalize" (html ...) and do a conditional to<br>
> see full? vs incremental?.<br>
><br>
> (define (write-page site page [out (current-output-port)])<br>
> (let ([data (normalize-response #t (hash-ref (site-table site) page))])<br>
> (cond<br>
> [(response/full? data)<br>
> (for ([bytes (response/full-body data)])<br>
> (write-bytes bytes out))]<br>
> [(response/incremental? data)<br>
> (error 'write-page "incremental responses unsupported")])))<br>
><br>
> I changed to<br>
><br>
> (define (write-page site page [out (current-output-port)])<br>
> (let ([data (hash-ref (site-table site) page)])<br>
> (cond<br>
> [(xexpr? data)<br>
> (write (xexpr->string data) out)]<br>
> [else<br>
> (error 'write-page "incremental responses unsupported")])))<br>
><br>
> Almost, but output is not quite right:<br>
><br>
> "<html><head><title>My Web Site</title></head><body><p>Check out my <a<br>
> href=\"cv.html\">CV.</a></p></body></html>"<br>
><br>
><br>
> Any advice on how to do it correctly?<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Tue, Apr 30, 2013 at 1:15 PM, Jay McCarthy <<a href="mailto:jay.mccarthy@gmail.com">jay.mccarthy@gmail.com</a>><br>
> wrote:<br>
>><br>
>> That package is incredibly old and used internal functions of the Web<br>
>> server. You'll have to look into what it was doing and update it to<br>
>> the modern documented server.<br>
>><br>
>> Jay<br>
>><br>
>> On Tue, Apr 30, 2013 at 11:12 AM, J G Cho <<a href="mailto:gcho@fundingmatters.com">gcho@fundingmatters.com</a>> wrote:<br>
>> > While trying out dherman's site generator (from<br>
>> ><br>
>> > planet.racket-lang.oracketg/package-source/dherman/static-page.plt/1/0/main.ss),<br>
>> > the following error is thrown:<br>
>> ><br>
>> > normalize-response: unbound identifier<br>
>> ><br>
>> > This procedure does not turn up in Search Manuals. Is there way to<br>
>> > fix/work<br>
>> > around this?<br>
>> ><br>
>> > jGc<br>
>> ><br>
>> > ____________________<br>
>> > Racket Users list:<br>
>> > <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
>> Assistant Professor / Brigham Young University<br>
>> <a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
>><br>
>> "The glory of God is Intelligence" - D&C 93<br>
><br>
><br>
<br>
<br>
<br>
--<br>
Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br>
<a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>
"The glory of God is Intelligence" - D&C 93<br>
</div></div></blockquote></div><br></div>