all repos — gomponents @ 8b43a908820fb8c6b8a0f6d68d11bb2596a9e033

HTML components in pure Go

Add links to godoc (#183) Also add an example for `http.Adapt`. Fixes #182

Markus Wüstenberg
commit

8b43a908820fb8c6b8a0f6d68d11bb2596a9e033

parent

a79e6d9d10099c418846280ae4a4997e82f6efee

1 file changed, 3 insertions(+), 2 deletions(-)

changed files
M components/components.gocomponents/components.go
@@ -10,7 +10,7 @@ g "github.com/maragudk/gomponents"
. "github.com/maragudk/gomponents/html" ) -// HTML5Props for HTML5. +// HTML5Props for [HTML5]. // Title is set no matter what, Description and Language elements only if the strings are non-empty. type HTML5Props struct { Title string
@@ -41,6 +41,7 @@ // The attribute value is a sorted, space-separated string of all the map keys,
// for which the corresponding map value is true. type Classes map[string]bool +// Render satisfies [g.Node]. func (c Classes) Render(w io.Writer) error { var included []string for c, include := range c {
@@ -56,7 +57,7 @@ func (c Classes) Type() g.NodeType {
return g.AttributeType } -// String satisfies fmt.Stringer. +// String satisfies [fmt.Stringer]. func (c Classes) String() string { var b strings.Builder _ = c.Render(&b)