all repos — gomponents @ 633b000d9115dbf7d4cc072cb1349268a09c3375

HTML components in pure Go

Add svg element (#46) Also add `cols` and `rows` attributes. Fixes #43.

Markus Wüstenberg
commit

633b000d9115dbf7d4cc072cb1349268a09c3375

parent

108f8d9ba564aef06155f6fdc83e140bb5953b3d

4 files changed, 15 insertions(+), 0 deletions(-)

changed files
M attr/simple.goattr/simple.go
@@ -20,6 +20,10 @@ func Class(v string) g.Node {
return g.Attr("class", v) } +func Cols(v string) g.Node { + return g.Attr("cols", v) +} + func Content(v string) g.Node { return g.Attr("content", v) }
@@ -78,6 +82,10 @@ }
func Rel(v string) g.Node { return g.Attr("rel", v) +} + +func Rows(v string) g.Node { + return g.Attr("rows", v) } func Src(v string) g.Node {
M attr/simple_test.goattr/simple_test.go
@@ -15,6 +15,7 @@ "accept": attr.Accept,
"autocomplete": attr.AutoComplete, "charset": attr.Charset, "class": attr.Class, + "cols": attr.Cols, "content": attr.Content, "form": attr.Form, "height": attr.Height,
@@ -30,6 +31,7 @@ "pattern": attr.Pattern,
"preload": attr.Preload, "placeholder": attr.Placeholder, "rel": attr.Rel, + "rows": attr.Rows, "src": attr.Src, "style": attr.Style, "tabindex": attr.TabIndex,
M el/simple.goel/simple.go
@@ -216,6 +216,10 @@ func Summary(children ...g.Node) g.NodeFunc {
return g.El("summary", children...) } +func SVG(children ...g.Node) g.NodeFunc { + return g.El("svg", children...) +} + func Table(children ...g.Node) g.NodeFunc { return g.El("table", children...) }
M el/simple_test.goel/simple_test.go
@@ -54,6 +54,7 @@ "section": el.Section,
"span": el.Span, "style": el.Style, "summary": el.Summary, + "svg": el.SVG, "table": el.Table, "tbody": el.TBody, "td": el.Td,