with-html-writer ( quot -- xml ) (original) (raw)
with-html-writer ( quot -- xml )
HTML streams
Prev: | ( -- html-writer ) |
---|
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
Hello
Definition
: with-html-writer ( quot -- xml )
[ swap with-output-stream ] keep data>> ;
inline