| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Hey! I just discovered this repo and I love being able to write
templates while still having compile-time checks.
I was looking through the code and noticed slices aren't currently
preallocated in `Map()` and `Classes.Render()`. Preallocating will
improve performance since the resulting slice won't have to be grown
dynamically during the append loop.
|
|
|
|
|
| |
This PR updates the HTML5 function to accept and render additional HTML
attributes. An additional test case to validate this enhancement has
been added as well.
|
|
|
|
|
|
|
|
|
|
| |
This is a breaking change to move gomponents to my own import namespace.
I will obviously be careful with this, test it out in all kinds of
scenarios, release betas, etc. But otherwise, because the `Node`
interface is so simple and has basically never changed, I don't think
this will break much. 🤞
Fixes #200
|
|
|
|
|
| |
Also add an example for `http.Adapt`.
Fixes #182
|
|
|
|
| |
I'd rather reserve the package for components that have proven
repeatedly useful, like `Classes` and `HTML5`.
|
|
|
|
|
| |
Using `t.Helper()`.
Also move the assert package to be internal.
|
|
|
| |
These show up in godoc.
|
|
|
| |
These are often used in the `<head>` part of the HTML.
|
|
|
|
|
| |
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.
|
|
|
| |
Inlining looks much nicer.
|
|
|
|
|
| |
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`.
|
| |
|
|
|
| |
Used to inline conditional nodes.
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Also update readme with features.
|
|
|