Added WHATWG HTML5 element defs

This commit is contained in:
Brandon Dyck 2019-03-28 21:00:53 -06:00
parent 62026132a8
commit 6948cdde4f
4 changed files with 1409 additions and 4 deletions

View File

@ -5,14 +5,119 @@
{"name": "src", "type": "string"} {"name": "src", "type": "string"}
], ],
"elements": [ "elements": [
{"name": "a"},
{"name": "abbr"},
{"name": "address"},
{"name": "area", "void": true},
{"name": "article"},
{"name": "aside"},
{"name": "audio"},
{"name": "b"},
{"name": "base", "void": true},
{"name": "bdi"},
{"name": "bdo"},
{"name": "blockquote"},
{"name": "body"}, {"name": "body"},
{"name": "br", "void": true},
{"name": "button"},
{"name": "canvas"},
{"name": "caption"},
{"name": "cite"},
{"name": "code"},
{"name": "col", "void": true},
{"name": "colgroup"},
{"name": "data"},
{"name": "datalist"},
{"name": "dd"},
{"name": "del"},
{"name": "details"},
{"name": "dfn"},
{"name": "dialog"},
{"name": "div"}, {"name": "div"},
{"name": "dl"},
{"name": "dt"},
{"name": "em"},
{"name": "embed", "void": true},
{"name": "fieldset"},
{"name": "figcaption"},
{"name": "figure"},
{"name": "footer"},
{"name": "form"},
{"name": "h1"},
{"name": "h2"},
{"name": "h3"},
{"name": "h4"},
{"name": "h5"},
{"name": "h6"},
{"name": "head"}, {"name": "head"},
{"name": "header"},
{"name": "hgroup"},
{"name": "hr", "void": true},
{"name": "html"}, {"name": "html"},
{"name": "i"},
{"name": "iframe"},
{"name": "img", "void": true}, {"name": "img", "void": true},
{"name": "input", "void": true},
{"name": "ins"},
{"name": "kbd"},
{"name": "label"},
{"name": "legend"},
{"name": "li"}, {"name": "li"},
{"name": "link", "void": true},
{"name": "main"},
{"name": "map"},
{"name": "mark"},
{"name": "math"},
{"name": "menu"},
{"name": "meta", "void": true},
{"name": "meter"},
{"name": "nav"},
{"name": "noscript"},
{"name": "object"},
{"name": "ol"},
{"name": "optgroup"},
{"name": "option"},
{"name": "output"},
{"name": "p"},
{"name": "param", "void": true},
{"name": "picture"},
{"name": "pre"},
{"name": "progress"},
{"name": "q"},
{"name": "rp"},
{"name": "rt"},
{"name": "ruby"},
{"name": "s"},
{"name": "samp"},
{"name": "script"},
{"name": "section"},
{"name": "select"},
{"name": "slot"},
{"name": "small"},
{"name": "source", "void": true},
{"name": "span"}, {"name": "span"},
{"name": "strong"},
{"name": "style"},
{"name": "sub"},
{"name": "summary"},
{"name": "sup"},
{"name": "svg"},
{"name": "table"},
{"name": "tbody"},
{"name": "td"},
{"name": "template"},
{"name": "textarea"},
{"name": "tfoot"},
{"name": "th"},
{"name": "thead"},
{"name": "time"},
{"name": "title"}, {"name": "title"},
{"name": "ul"} {"name": "tr"},
{"name": "track", "void": true},
{"name": "u"},
{"name": "ul"},
{"name": "var"},
{"name": "video"},
{"name": "wbr", "void": true}
] ]
} }

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,8 @@ package html5
import "gitlab.codemonkeysoftware.net/b/hatmill" import "gitlab.codemonkeysoftware.net/b/hatmill"
// Data creates an attribute of the form "data-suffix='value'". // CustomData creates an attribute of the form data-suffix='value'.
func Data(suffix, value string) hatmill.Attrib { func CustomData(suffix, value string) hatmill.Attrib {
return hatmill.Attrib{ return hatmill.Attrib{
Key: "data-" + suffix, Key: "data-" + suffix,
Value: value, Value: value,

View File

@ -17,7 +17,7 @@ func Example() {
html5.Div()( html5.Div()(
html5.Img(html5.Src("./me.jpg"), html5.Id("profile-photo")), html5.Img(html5.Src("./me.jpg"), html5.Id("profile-photo")),
html5.Text(html.EscapeString(userInput)), html5.Text(html.EscapeString(userInput)),
html5.Div(html5.Disabled(), html5.Data("coolness", "awesome"))(), html5.Div(html5.Disabled(), html5.CustomData("coolness", "awesome"))(),
), ),
), ),
) )