Runtime support for the stdlib HTML syntax macro.
API Reference
Protocols
protocol RenderHtml
Converts a value to an HTML-safe string; the default escapes its Showable representation.
Structs
struct Markup
An HTML fragment trusted for direct insertion into a rendered document.
struct PreEscaped
Text explicitly marked as already escaped or known-safe HTML.
Globals
let DOCTYPE
The HTML5 doctype declaration as trusted markup.
Functions
func render_html<Value: RenderHtml>(value: Value) -> String
Dispatches to the value's HTML-safe rendering implementation.
func append_html_class(classes: String, value: String) -> String
Appends one class value to an existing space-separated class list.
func render_class_attribute(value: String) -> String
Wraps a macro-generated class list in a leading-space class attribute.
func render_optional_html_attribute<Value: RenderHtml>(name: String, consume value: Value?) -> String
Renders a leading-space attribute only when value is present.
func render_html_loop<Values: Iterable>(values: Values, consume body: (Values.Element) -> String) -> String
Concatenates a rendered macro body for every element in iteration order.