2 USING: help.markup help.syntax kernel strings io io.styles
6 { $values { "object" object } { "url" string } }
7 { $contract "Outputs a link to a page displaying a presentation of the given object. This word is called when " { $link write-object } " is called on " { $link html-writer } " instances." } ;
10 { $class-description "A formatted output stream which accumulates HTML markup as " { $vocab-link "xml.data" } " types. The " { $slot "data" } " slot contains a sequence with all markup so far." } ;
13 { $values { "html-writer" html-writer } }
14 { $description "Creates a new formatted output stream which accumulates HTML markup in its " { $snippet "data" } " slot." } ;
16 HELP: with-html-writer
17 { $values { "quot" quotation } { "xml" xml-chunk } }
18 { $description "Calls the quotation in a new dynamic scope with " { $link output-stream } " rebound to an " { $link html-writer } ". When the quotation returns, outputs the accumulated HTML markup." }
21 "USING: io io.styles html.streams xml.writer ;"
22 "[ \"Hello\" { { font-style bold } } format nl ] with-html-writer write-xml"
23 "<span style=\"font-style: normal; font-weight: bold; \">Hello</span><br/>"
27 ARTICLE: "html.streams" "HTML streams"
28 "The " { $vocab-link "html.streams" } " vocabulary provides a stream which implements " { $link "io.styles" } " by constructing HTML markup in the form of " { $vocab-link "xml.data" } " types."
29 { $subsection html-writer }
30 { $subsection <html-writer> }
31 { $subsection with-html-writer } ;