diff --git a/elem.go b/elem.go index cf2d086..2b9c2a1 100644 --- a/elem.go +++ b/elem.go @@ -179,7 +179,7 @@ func (e *Element) Render() string { return builder.String() } -func NewElement(tag string, attrs attrs.Props, children ...Node) *Element { +func newElement(tag string, attrs attrs.Props, children ...Node) *Element { return &Element{ Tag: tag, Attrs: attrs, diff --git a/elements.go b/elements.go index f71480f..c2b7fa6 100644 --- a/elements.go +++ b/elements.go @@ -8,99 +8,99 @@ import ( // Body creates a
element. func Body(attrs attrs.Props, children ...Node) *Element { - return NewElement("body", attrs, children...) + return newElement("body", attrs, children...) } // Head creates a element. func Head(attrs attrs.Props, children ...Node) *Element { - return NewElement("head", attrs, children...) + return newElement("head", attrs, children...) } // Html creates an element. func Html(attrs attrs.Props, children ...Node) *Element { - return NewElement("html", attrs, children...) + return newElement("html", attrs, children...) } // Title creates a element.
func Blockquote(attrs attrs.Props, children ...Node) *Element {
- return NewElement("blockquote", attrs, children...)
+ return newElement("blockquote", attrs, children...)
}
// Code creates a element.
func Code(attrs attrs.Props, children ...Node) *Element {
- return NewElement("code", attrs, children...)
+ return newElement("code", attrs, children...)
}
// Div creates a element.
func Div(attrs attrs.Props, children ...Node) *Element {
- return NewElement("div", attrs, children...)
+ return newElement("div", attrs, children...)
}
// Em creates an element.
func Em(attrs attrs.Props, children ...Node) *Element {
- return NewElement("em", attrs, children...)
+ return newElement("em", attrs, children...)
}
// H1 creates an element.
func H1(attrs attrs.Props, children ...Node) *Element {
- return NewElement("h1", attrs, children...)
+ return newElement("h1", attrs, children...)
}
// H2 creates an element.
func H2(attrs attrs.Props, children ...Node) *Element {
- return NewElement("h2", attrs, children...)
+ return newElement("h2", attrs, children...)
}
// H3 creates an element.
func H3(attrs attrs.Props, children ...Node) *Element {
- return NewElement("h3", attrs, children...)
+ return newElement("h3", attrs, children...)
}
// H4 creates an element.
func Hr(attrs attrs.Props) *Element {
- return NewElement("hr", attrs)
+ return newElement("hr", attrs)
}
// I creates an element.
func I(attrs attrs.Props, children ...Node) *Element {
- return NewElement("i", attrs, children...)
+ return newElement("i", attrs, children...)
}
// P creates a
element.
func P(attrs attrs.Props, children ...Node) *Element {
- return NewElement("p", attrs, children...)
+ return newElement("p", attrs, children...)
}
// Pre creates a
element.
func Pre(attrs attrs.Props, children ...Node) *Element {
- return NewElement("pre", attrs, children...)
+ return newElement("pre", attrs, children...)
}
// Span creates a element.
func Span(attrs attrs.Props, children ...Node) *Element {
- return NewElement("span", attrs, children...)
+ return newElement("span", attrs, children...)
}
// Strong creates a element.
func Strong(attrs attrs.Props, children ...Node) *Element {
- return NewElement("strong", attrs, children...)
+ return newElement("strong", attrs, children...)
}
// Text creates a TextNode.
@@ -117,103 +117,103 @@ func Comment(comment string) CommentNode {
// Li creates an element.
func Li(attrs attrs.Props, children ...Node) *Element {
- return NewElement("li", attrs, children...)
+ return newElement("li", attrs, children...)
}
// Ul creates a element.
func Ul(attrs attrs.Props, children ...Node) *Element {
- return NewElement("ul", attrs, children...)
+ return newElement("ul", attrs, children...)
}
// Ol creates an element.
func Ol(attrs attrs.Props, children ...Node) *Element {
- return NewElement("ol", attrs, children...)
+ return newElement("ol", attrs, children...)
}
// Dl creates a element.
func Dl(attrs attrs.Props, children ...Node) *Element {
- return NewElement("dl", attrs, children...)
+ return newElement("dl", attrs, children...)
}
// Dt creates a - element.
func Dt(attrs attrs.Props, children ...Node) *Element {
- return NewElement("dt", attrs, children...)
+ return newElement("dt", attrs, children...)
}
// Dd creates a
- element.
func Dd(attrs attrs.Props, children ...Node) *Element {
- return NewElement("dd", attrs, children...)
+ return newElement("dd", attrs, children...)
}
// ========== Forms ==========
// Button creates a