hatmill/html5/html5.go

20 lines
580 B
Go
Raw Normal View History

2019-03-25 01:56:24 +00:00
package html5
2019-03-29 02:21:04 +00:00
//go:generate go run ../internal/codegen/codegen.go -input defs.json -output generated.go -package html5 -import
2019-03-25 01:56:24 +00:00
import "gitlab.codemonkeysoftware.net/b/hatmill"
2019-03-29 03:00:53 +00:00
// CustomData creates an attribute of the form data-suffix='value'.
func CustomData(suffix, value string) hatmill.Attrib {
2019-03-25 01:56:24 +00:00
return hatmill.Attrib{
Key: "data-" + suffix,
Value: value,
}
}
// Text converts a string to a hatmill.Text. Text(s) is functionally identical
// to hatmill.Text(s) and is reproduced here for convenience.
func Text(s string) hatmill.Text {
return hatmill.Text(s)
}