Handbook
Glossary
with-html-writer ( quot -- xml )
HTML streams
Prev:
<html-writer> ( -- html-writer )
Vocabulary
html
.
streams
Inputs
quot
a
quotation
Outputs
xml
a
xml-chunk
Word description
Calls the quotation in a new dynamic scope with
output-stream
rebound to an
html-writer
. When the quotation returns, outputs the accumulated HTML markup.
Examples
USING: io io.styles html.streams xml.writer ; [ "Hello" { { font-style bold } } format nl ] with-html-writer write-xml
<span style="font-style: normal; font-weight: bold; ">Hello</span><br/>
Definition
USING:
accessors
io
kernel
;
IN:
html.streams
:
with-html-writer
( quot -- xml )
<html-writer>
[
swap
with-output-stream
]
keep
data>>
;
inline