1 USING: html.streams html.streams.private accessors io
2 io.streams.string io.styles kernel namespaces tools.test
3 xml.writer sbufs sequences inspector colors ;
7 [ with-html-writer ] with-string-writer ; inline
9 [ [ ] make-html-string ] must-infer
12 512 <sbuf> <html-stream> drop
16 [ "" write ] make-html-string
20 [ CHAR: a write1 ] make-html-string
24 [ "<" write ] make-html-string
28 [ "<" H{ } output-stream get format-html-span ] make-html-string
33 M: funky browser-link-href
34 "http://www.funky-town.com/" swap town>> append ;
36 [ "<a href='http://www.funky-town.com/austin'><</a>" ] [
38 "<" "austin" funky boa write-object
42 [ "<span style='font-family: monospace; '>car</span>" ]
46 H{ { font "monospace" } }
51 [ "<span style='color: #ff00ff; '>car</span>" ]
55 H{ { foreground T{ rgba f 1 0 1 1 } } }
60 [ "<div style='background-color: #ff00ff; white-space: pre; font-family: monospace; '>cdr</div>" ]
63 H{ { page-color T{ rgba f 1 0 1 1 } } }
64 [ "cdr" write ] with-nesting
69 "<div style='white-space: pre; font-family: monospace; '></div>"
71 [ H{ } [ ] with-nesting nl ] make-html-string
74 [ ] [ [ { 1 2 3 } describe ] with-html-writer ] unit-test