IN: html.elements USING: help.markup help.syntax io present ; ARTICLE: "html.elements" "HTML elements" "The " { $vocab-link "html.elements" } " vocabulary provides words for writing HTML tags to the " { $link output-stream } " with a familiar look and feel in the code." $nl "HTML tags can be used in a number of different ways. The simplest is a tag with no attributes:" { $code "
\"someoutput\" write
" } "In the above, " { $link} " will output the opening tag with no attributes. and " { $link
} " will output the closing tag." { $code "\"someoutput\" write
" } "This time the opening tag does not have the '>'. Any attribute words used between the calls to " { $link} " will write an attribute whose value is the top of the stack. Attribute values can be any object supported by the " { $link present } " word." $nl "Values for attributes can be used directly without any stack operations. Assuming we have a string on the stack, all three of the below will output a link:" { $code " \"Click me\" write " } { $code " \"click\" write " } { $code " \"click\" write " } "Tags that have no “closing” equivalent have a trailing " { $snippet "tag/>" } " form:" { $code "" } "For the full list of HTML tags and attributes, consult the word list for the " { $vocab-link "html.elements" } " vocabulary. In addition to HTML tag and attribute words, a few utilities are provided." $nl "Writing unescaped HTML to " { $vocab-link "html.streams" } ":" { $subsection write-html } { $subsection print-html } "Writing some common HTML patterns:" { $subsection xhtml-preamble } { $subsection simple-page } { $subsection render-error } ; ABOUT: "html.elements"