From ff99e32d1f95504588a4c685e7c710e90b09c85c Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:42:43 -0800 Subject: [PATCH] Add comments to element functions --- elements.go | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/elements.go b/elements.go index 01bcbea..aa7d12e 100644 --- a/elements.go +++ b/elements.go @@ -6,168 +6,207 @@ import ( // ========== Document Structure ========== +// Body creates a
element. func Body(attrs attrs.Props, children ...Node) *Element { return NewElement("body", attrs, children...) } +// Head creates a element. func Head(attrs attrs.Props, children ...Node) *Element { return NewElement("head", attrs, children...) } +// Html creates an element. func Html(attrs attrs.Props, children ...Node) *Element { return NewElement("html", attrs, children...) } +// Title creates a element.
func Blockquote(attrs attrs.Props, children ...Node) *Element {
return NewElement("blockquote", attrs, children...)
}
+// Code creates a element.
func Code(attrs attrs.Props, children ...Node) *Element {
return NewElement("code", attrs, children...)
}
+// Div creates a element.
func Div(attrs attrs.Props, children ...Node) *Element {
return NewElement("div", attrs, children...)
}
+// Em creates an element.
func Em(attrs attrs.Props, children ...Node) *Element {
return NewElement("em", attrs, children...)
}
+// H1 creates an element.
func H1(attrs attrs.Props, children ...Node) *Element {
return NewElement("h1", attrs, children...)
}
+// H2 creates an element.
func H2(attrs attrs.Props, children ...Node) *Element {
return NewElement("h2", attrs, children...)
}
+// H3 creates an element.
func H3(attrs attrs.Props, children ...Node) *Element {
return NewElement("h3", attrs, children...)
}
+// H4 creates an element.
func Hr(attrs attrs.Props) *Element {
return NewElement("hr", attrs)
}
+// I creates an element.
func I(attrs attrs.Props, children ...Node) *Element {
return NewElement("i", attrs, children...)
}
+// P creates a
element.
func P(attrs attrs.Props, children ...Node) *Element {
return NewElement("p", attrs, children...)
}
+// Pre creates a
element.
func Pre(attrs attrs.Props, children ...Node) *Element {
return NewElement("pre", attrs, children...)
}
+// Span creates a element.
func Span(attrs attrs.Props, children ...Node) *Element {
return NewElement("span", attrs, children...)
}
+// Strong creates a element.
func Strong(attrs attrs.Props, children ...Node) *Element {
return NewElement("strong", attrs, children...)
}
+// Text creates a TextNode.
func Text(content string) TextNode {
return TextNode(content)
}
+// Comment creates a CommentNode.
func Comment(comment string) CommentNode {
return CommentNode(comment)
}
// ========== Lists ==========
+// Li creates an element.
func Li(attrs attrs.Props, children ...Node) *Element {
return NewElement("li", attrs, children...)
}
+// Ul creates a element.
func Ul(attrs attrs.Props, children ...Node) *Element {
return NewElement("ul", attrs, children...)
}
+// Ol creates an element.
func Ol(attrs attrs.Props, children ...Node) *Element {
return NewElement("ol", attrs, children...)
}
+// Dl creates a element.
func Dl(attrs attrs.Props, children ...Node) *Element {
return NewElement("dl", attrs, children...)
}
+// Dt creates a - element.
func Dt(attrs attrs.Props, children ...Node) *Element {
return NewElement("dt", attrs, children...)
}
+// Dd creates a
- element.
func Dd(attrs attrs.Props, children ...Node) *Element {
return NewElement("dd", attrs, children...)
}
// ========== Forms ==========
+// Button creates a