about summary refs log tree commit diff stats
path: root/gomponents.go
Commit message (Collapse)AuthorAgeLines
* Remove fmt.Sprintf call in attribute Render (#38)Markus Wüstenberg2020-10-29-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just concatenating the strings is much faster. Before: ``` make benchmark go test -bench=. goos: darwin goarch: amd64 pkg: github.com/maragudk/gomponents BenchmarkAttr/boolean_attributes-8 8194791 139 ns/op BenchmarkAttr/name-value_attributes-8 5143292 229 ns/op PASS ok github.com/maragudk/gomponents 2.841s ``` After: ``` make benchmark go test -bench=. goos: darwin goarch: amd64 pkg: github.com/maragudk/gomponents BenchmarkAttr/boolean_attributes-8 16755404 67.0 ns/op BenchmarkAttr/name-value_attributes-8 10208625 116 ns/op PASS ok github.com/maragudk/gomponents 2.702s ```
* Pass attributes as pointers (#37)Markus Wüstenberg2020-10-29-5/+5
|
* Don't render or error on nil children (#32)Markus Wüstenberg2020-10-23-0/+3
| | | This makes it easier to e.g. conditionally skip a component for rendering.
* Add Group function to group Nodes (#29)Markus Wüstenberg2020-10-22-11/+36
|
* Update package doc for gomponents (#28)Markus Wüstenberg2020-10-21-1/+1
|
* Use HTMLEscapeString in Textf (#27)Markus Wüstenberg2020-10-21-1/+1
|
* Use HTMLEscapeString (#24)Markus Wüstenberg2020-09-25-1/+1
| | | HTMLEscaper is not needed with strings.
* Add space before auto-closing element (#20)Markus Wüstenberg2020-09-24-2/+2
|
* Introduce Placer interface (#18)Markus Wüstenberg2020-09-24-8/+36
| | | | | When implemented, the `Place` method of the `Placer` interface tells `Render` in `El` where to put a Node. This is relevant for helpers that want to be rendered like attributes, inside the parent element. Fixes the bug where `attr.Classes` was rendered outside the element.
* Add Textf function (#17)Markus Wüstenberg2020-09-23-0/+7
| | | Like Text, but calls fmt.Sprintf before rendering.
* Add a Write function (#11)Markus Wüstenberg2020-09-21-0/+7
|
* Don't render twice with children (#9)Markus Wüstenberg2020-09-21-4/+3
|
* Make NodeFunc and attr implement fmt.Stringer (#6)Markus Wüstenberg2020-09-18-0/+10
|
* Add package documentation (#1)Markus Wüstenberg2020-09-14-0/+7
|
* Add first implementation of Node, El, Attr, TextMarkus Wüstenberg2020-09-13-0/+100