about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeLines
...
* Remove fmt.Sprintf call in attribute Render (#38)Markus Wüstenberg2020-10-29-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* Add HTML5 document template (#36)Markus Wüstenberg2020-10-29-0/+129
|
* Add attribute helpers (#35)Markus Wüstenberg2020-10-28-72/+243
| | | Also refactor tests to be table-driven, for readability.
* Add element helpers and refactor (#34)Markus Wüstenberg2020-10-28-487/+556
| | | | | | | This change adds a lot of element helpers, and refactors: - helpers into simple, text, and other helpers - most tests into table-driven tests, so they're easier to read Thanks to @oderwat for pushing me to improve the tests. 😉
* Add contributing instructions (#33)Markus Wüstenberg2020-10-23-0/+18
|
* Add br and hr element helpers (#30)Hans Raaf2020-10-23-0/+21
|
* Remove "fmt" import in readme example (#31)Hans Raaf2020-10-23-3/+6
| | | Also style menu in simple example slightly.
* Don't render or error on nil children (#32)Markus Wüstenberg2020-10-23-0/+8
| | | 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-43/+78
|
* 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
|
* Add remaining sectioning elements as helpers (#25)Markus Wüstenberg2020-09-25-0/+105
| | | Fixes #22.
* Use HTMLEscapeString (#24)Markus Wüstenberg2020-09-25-1/+1
| | | HTMLEscaper is not needed with strings.
* Update readme with blog post link (#23)Markus Wüstenberg2020-09-25-1/+4
|
* Group element helpers in different files (#21)Markus Wüstenberg2020-09-25-302/+368
| | | According to the section at https://developer.mozilla.org/en-US/docs/Web/HTML/Element
* Add space before auto-closing element (#20)Markus Wüstenberg2020-09-24-30/+30
|
* Add convenience helpers for form elements (#19)Markus Wüstenberg2020-09-24-3/+148
|
* Introduce Placer interface (#18)Markus Wüstenberg2020-09-24-8/+57
| | | | | 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-1/+15
| | | Like Text, but calls fmt.Sprintf before rendering.
* Add better example in readme (#16)Markus Wüstenberg2020-09-23-7/+34
|
* Add children varargs to h1-6, b, strong, i, em, img helpers (#15)Markus Wüstenberg2020-09-23-33/+35
| | | This makes it possible to add attributes.
* Make attr.Classes a map type (#14)Markus Wüstenberg2020-09-23-7/+22
| | | This makes the usage syntax prettier. Instead of `attr.Classes(map[string]bool{})`, we can just use `attr.Classes{}`.
* Add simple example (#13)Markus Wüstenberg2020-09-21-0/+103
|
* Add a test for attr.String (#12)Markus Wüstenberg2020-09-21-0/+9
|
* Add a Write function (#11)Markus Wüstenberg2020-09-21-0/+37
|
* Add a lot of common elements (#10)Markus Wüstenberg2020-09-21-0/+216
| | | Especially add elements that are either used in every document, that nearly always have text content, or that are almost always used with certain attributes.
* Don't render twice with children (#9)Markus Wüstenberg2020-09-21-4/+3
|
* Add package el with element helpers (#8)Markus Wüstenberg2020-09-18-0/+80
|
* Add package attr with attribute helpers (#7)Markus Wüstenberg2020-09-18-0/+64
|
* Make NodeFunc and attr implement fmt.Stringer (#6)Markus Wüstenberg2020-09-18-15/+43
|
* Try out codecov.io (#5)Markus Wüstenberg2020-09-18-1/+5
|
* Add Makefile (#4)Markus Wüstenberg2020-09-18-0/+12
|
* Create codeql-analysis.yml (#3)Markus Wüstenberg2020-09-15-0/+66
|
* Add godoc link to readme (#2)Markus Wüstenberg2020-09-14-1/+3
|
* Add package documentation (#1)Markus Wüstenberg2020-09-14-0/+7
|
* Add first implementation of Node, El, Attr, TextMarkus Wüstenberg2020-09-13-0/+264