File "markup"

This file provides predicates to generate markup. This is done through filtered streams that automatically escape plain text. We provide markup streams that are either piggy backed on ordinary streams, or piggy backed on a DOM elements or are not piggy backed at all. The escaping can be bypassed by the predicates tag/[1,2] and tag_format/[2,3].

Markup streams on a DOM elements do not attempt at pretty printing by inserting newlines and spaces depending on the given tag. They go trough a state machine to track the current DOM element and leave the interpretation completely to the browser. Markup streams that are not piggy backed attempt a translation to ASCII escape sequences.

The following markup predicates are provided:

tag(M):
tag(W, A):
The predicate emits the start tag, end tag or single tag M. The binary predicate allows specifying a DOM writer W.
tag_format(T, L):
tag_format(W, T, L):
The predicate emits the start tag, end tag or single tag that results from formatting the template T with the arguments L.The ternary predicate allows specifying a DOM writer W.
dom_output_new(S, W):
The predicate succeeds in W with a new markup writer to the stream S.