1
0
Commit Graph

32 Commits

Author SHA1 Message Date
Markus Wüstenberg
8f17dba6f1
Add contributing instructions (#33) 2020-10-23 14:32:55 +02:00
Hans Raaf
c6c5fbd0f9
Add br and hr element helpers (#30) 2020-10-23 14:12:47 +02:00
Hans Raaf
c99025e6c5
Remove "fmt" import in readme example (#31)
Also style menu in simple example slightly.
2020-10-23 12:32:47 +02:00
Markus Wüstenberg
3198b25445
Don't render or error on nil children (#32)
This makes it easier to e.g. conditionally skip a component for rendering.
2020-10-23 12:14:23 +02:00
Markus Wüstenberg
6d2fb0eeb1
Add Group function to group Nodes (#29) 2020-10-22 09:07:57 +02:00
Markus Wüstenberg
f2a2b94970
Update package doc for gomponents (#28) 2020-10-21 22:17:27 +02:00
Markus Wüstenberg
42433a4a09
Use HTMLEscapeString in Textf (#27) 2020-10-21 21:59:52 +02:00
Markus Wüstenberg
4448a48d85
Add remaining sectioning elements as helpers (#25)
Fixes #22.
2020-09-25 17:36:21 +02:00
Markus Wüstenberg
83faa4caa3
Use HTMLEscapeString (#24)
HTMLEscaper is not needed with strings.
2020-09-25 13:39:55 +02:00
Markus Wüstenberg
5d5933899c
Update readme with blog post link (#23) 2020-09-25 12:32:50 +02:00
Markus Wüstenberg
5da578cfdf
Group element helpers in different files (#21)
According to the section at https://developer.mozilla.org/en-US/docs/Web/HTML/Element
2020-09-25 09:57:47 +02:00
Markus Wüstenberg
77b64b1302
Add space before auto-closing element (#20) 2020-09-24 21:55:11 +02:00
Markus Wüstenberg
5929ba8c41
Add convenience helpers for form elements (#19) 2020-09-24 21:17:15 +02:00
Markus Wüstenberg
4c109f9f1d
Introduce Placer interface (#18)
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.
2020-09-24 13:19:52 +02:00
Markus Wüstenberg
f27cb0c05f
Add Textf function (#17)
Like Text, but calls fmt.Sprintf before rendering.
2020-09-23 22:10:35 +02:00
Markus Wüstenberg
3de9270f78
Add better example in readme (#16) 2020-09-23 22:05:59 +02:00
Markus Wüstenberg
eb2cfa10c2
Add children varargs to h1-6, b, strong, i, em, img helpers (#15)
This makes it possible to add attributes.
2020-09-23 20:35:16 +02:00
Markus Wüstenberg
05c31515c6
Make attr.Classes a map type (#14)
This makes the usage syntax prettier. Instead of `attr.Classes(map[string]bool{})`, we can just use `attr.Classes{}`.
2020-09-23 20:30:14 +02:00
Markus Wüstenberg
c832941edb
Add simple example (#13) 2020-09-21 16:30:29 +02:00
Markus Wüstenberg
18b52ffda1
Add a test for attr.String (#12) 2020-09-21 16:07:39 +02:00
Markus Wüstenberg
d78ed7efc7
Add a Write function (#11) 2020-09-21 11:27:37 +02:00
Markus Wüstenberg
8de5a685ef
Add a lot of common elements (#10)
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.
2020-09-21 11:23:47 +02:00
Markus Wüstenberg
02d963de10
Don't render twice with children (#9) 2020-09-21 11:14:37 +02:00
Markus Wüstenberg
4d9f1c2aed
Add package el with element helpers (#8) 2020-09-18 15:01:10 +02:00
Markus Wüstenberg
f7812a9f06
Add package attr with attribute helpers (#7) 2020-09-18 14:44:47 +02:00
Markus Wüstenberg
f9d584c988
Make NodeFunc and attr implement fmt.Stringer (#6) 2020-09-18 14:38:09 +02:00
Markus Wüstenberg
e8faab5207
Try out codecov.io (#5) 2020-09-18 14:05:53 +02:00
Markus Wüstenberg
15d2cc9373
Add Makefile (#4) 2020-09-18 13:57:04 +02:00
Markus Wüstenberg
a564fd6cee
Create codeql-analysis.yml (#3) 2020-09-15 09:40:58 +02:00
Markus Wüstenberg
ad47ed56f1
Add godoc link to readme (#2) 2020-09-14 10:51:29 +02:00
Markus Wüstenberg
ca80dce018
Add package documentation (#1) 2020-09-14 10:47:14 +02:00
Markus Wüstenberg
fc3cc0f0f3 Add first implementation of Node, El, Attr, Text 2020-09-13 22:50:19 +02:00