Héllo Jakub,
On 2016-07-10 21:58, Jakub Jankiewicz wrote:
Hi,
I want to render scheme code inside script tag to be executed by
biwascheme
in the browser so I've try to create simple page using sxml (cgi
script):
(sxml->xml `(html
(head
(title "BiwaScheme test")
(script (@ (src "biwascheme-min.js")) "(display
\"hello\")"))
(body (p "BiwaScheme test"))))
This is sxml to *xml*. The correct procedure you have to use
is `sxml->html' which can be found in haunt code [1]. Basically
it takes care of auto-closing tags like <br/>... and doing more
escaping...
That said it has the same issue with script tag!
I attached a fixed version of html.scm which works in the case where
`script' has a single element as body...
Here is an example:
(sxml->html-string '(html (head (script (@ (lang "biwascheme"))
"load(app.scm)")) (body (h1 "héllo") "world")))
$1 = <html><head><script
lang="biwascheme">load(app.scm)</script></head><body><h1>hllo</h1>world</body></html>
Biwascheme is super nice! Do you plan to work with a particular
javascript library?
HTH!
[1] https://git.dthompson.us/haunt.git/blob_plain/HEAD:/haunt/html.scm
--
Amirouche ~ amz3 ~ http://www.hyperdev.fr