1
0
Commit Graph

14 Commits

Author SHA1 Message Date
Markus Wüstenberg
b12942fb32
Delete low-value helper components (#115)
I'd rather reserve the package for components that have proven
repeatedly useful, like `Classes` and `HTML5`.
2022-11-03 11:32:16 +01:00
Markus Wüstenberg
4858e5d47d
Mark the assert test helpers as such (#90)
Using `t.Helper()`.

Also move the assert package to be internal.
2021-10-06 20:49:43 +02:00
Markus Wüstenberg
ba0d83f4fb
Add examples in test files (#80)
These show up in godoc.
2021-06-08 18:12:04 +02:00
Markus Wüstenberg
7c0f2e4cbb
Add LinkStylesheet and LinkPreload components (#79)
These are often used in the `<head>` part of the HTML.
2021-06-08 16:52:57 +02:00
Markus Wüstenberg
3b7dceab89
Streamline HTML element API (#66)
There were a lot of elements previously, like `Em`, `H1`, and a lot more, that took a string as the first argument previously. This was weird when you wanted to mix elements to output html like `<strong><em>…</em></strong>` or `<h1>Something <em>something</em> something</h1>`. gomponents is not an HTML validator, so I want people to be able to use elements however they please, also without text content.

This also means that all elements now have the same API.
2021-05-05 09:03:16 +02:00
Markus Wüstenberg
5d2f0f1b87
Use g.If in HTML5 helper (#65)
Inlining looks much nicer.
2021-04-28 10:42:49 +02:00
Markus Wüstenberg
c899a050c0
Return Node from all helpers instead of NodeFunc (#62)
This makes it clearer that the helpers return a `Node` of any kind, and that the type is not important.

This also streamlines the API, as attribute helpers already return just `Node`.
2021-01-07 10:20:03 +01:00
Markus Wüstenberg
b4918d5a63
Add test for InputHidden (#60) 2020-12-22 11:12:45 +01:00
Markus Wüstenberg
f22ce3fb68
Add If helper function (#57)
Used to inline conditional nodes.
2020-12-22 10:53:22 +01:00
Markus Wüstenberg
100ae9e830
Rename Document to Doctype (#54) 2020-12-10 13:13:10 +01:00
Markus Wüstenberg
a76262652b
Move elements and attributes into html package (#52)
This makes it easier to use dot-imports.

Also updated the readme and examples with new usage, and move the `Classes` helper into the `components` package.
2020-12-10 13:00:23 +01:00
Markus Wüstenberg
794c3b26ac
Render correct HTML5 (#44)
Previously, elements of kind void and empty elements generally would be rendered auto-closing (with a final `/` character in the start tag), which is allowed sometimes but arguably wrong. See https://dev.w3.org/html5/spec-LC/syntax.html#end-tags

This created problems with for example `textarea` and `script`, which cannot be auto-closing, or the browser renders it wrong.

Also clarified in the docs that this library outputs HTML5.

Fixes #42.
2020-11-16 12:38:24 +01:00
Markus Wüstenberg
87d09c3824
Add package docs (#41)
Also update readme with features.
2020-11-02 11:05:23 +01:00
Markus Wüstenberg
3df42084ae
Add HTML5 document template (#36) 2020-10-29 12:03:43 +01:00