abla/html
Generated from source.
Import with import "abla/html".
Source: abla/html/entry.ab
HtmlAttribute (class)
class HtmlAttribute(val name: string, val value: string?, val sourceQuote: string = "")
An attribute in rendering order. A null value represents a bare attribute.
Html (class)
class Html(
val kind: int,
val tag: string,
val text: string,
val children: array<Html>,
val attributes: array<HtmlAttribute> = [],
val selfClosing: bool = false,
val literalText: bool = false
)
A phase-safe node. Kind 0 is missing, 1 is an element, 2 is text, and 3 is explicit raw markup.
ablaHtmlUnarySyntaxCall (compile.fun)
compile fun ablaHtmlUnarySyntaxCall(name: string, value: SyntaxExpression): SyntaxExpression
Builds an Abla call expression with the supplied name and one argument.
ablaHtmlParse (compile.fun)
compile fun ablaHtmlParse(cursor: ParserCursor): SyntaxExpression
Lowers a literal element and reports malformed attributes, tags and children.
ablaHtmlEmpty (fun)
fun ablaHtmlEmpty(): Html
Returns the kind 0 sentinel for a missing HTML node.
ablaHtmlElement (fun)
fun ablaHtmlElement(tag: string, children: array<Html>): Html
Creates an element node with the supplied children in order.
ablaHtmlElementWithAttributes (fun)
fun ablaHtmlElementWithAttributes(tag: string, children: array<Html>, groups: array<array<HtmlAttribute>>, selfClosing: bool = false): Html
Creates an element node and copies its attribute groups into one ordered list.
ablaHtmlAttribute (fun)
fun ablaHtmlAttribute(name: string, value: string): HtmlAttribute
Returns an attribute whose value is escaped on serialization. Invalid names are omitted when rendered.
ablaHtmlBooleanAttribute (fun)
fun ablaHtmlBooleanAttribute(name: string): HtmlAttribute
Returns a bare attribute. Invalid names are omitted when rendered.
ablaHtmlLiteralAttribute (fun)
fun ablaHtmlLiteralAttribute(name: string, value: string, quote: string): HtmlAttribute
Returns an authored attribute, retaining valid source quotes and character references on serialization.
ablaHtmlText (fun)
fun ablaHtmlText(value: string): Html
Returns a text node whose contents are escaped on serialization.
ablaHtmlLiteralText (fun)
fun ablaHtmlLiteralText(value: string): Html
Returns authored text with character references retained and opening angle brackets escaped.
ablaHtmlRaw (fun)
fun ablaHtmlRaw(value: string): Html
Returns trusted markup for verbatim insertion. Supply markup generated by a trusted renderer or authored in source.
ablaHtmlDynamic (fun)
fun ablaHtmlDynamic(value: any): Html
Converts an Abla value to escaped HTML text through the normal interpolation conversion.
ablaHtmlDynamic (fun)
fun ablaHtmlDynamic(value: Html): Html
Returns an existing HTML subtree for insertion without converting it to text.
Html.render (extension fun)
fun Html.render(): string
Serializes this tree as HTML text, escaping text and dynamic attribute values. Missing nodes and invalid element names render as empty text.
Html.querySelector (extension fun)
fun Html.querySelector(tag: string): Html
Searches this tree in preorder for the first element whose tag exactly equals nonempty tag. Returns the missing-node sentinel if none matches.
$html (sub-language)
#compilerRegisterSubparser("html", ablaHtmlParse)
Builds an Html tree from one element, with checked attributes and Abla expression holes.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.