Document Text/Textf helpers better (#135)
Both in the readme and package doc. Fixes #133.
This commit is contained in:
commit
4f9709afcc
@ -25,14 +25,16 @@ Made in 🇩🇰 by [maragu](https://www.maragu.dk), maker of [online Go courses
|
||||
- Auto-completion
|
||||
- Nice formatting with `gofmt`
|
||||
- Simple API that's easy to learn and use (you know most already if you know HTML)
|
||||
- Useful helpers like `Text` and `Textf` that insert HTML-escaped text, `Map` for mapping data to components,
|
||||
and `If` for conditional rendering.
|
||||
- No external dependencies
|
||||
|
||||
## Usage
|
||||
|
||||
Get the library using `go get`:
|
||||
|
||||
```shell script
|
||||
go get -u github.com/maragudk/gomponents
|
||||
```shell
|
||||
go get github.com/maragudk/gomponents
|
||||
```
|
||||
|
||||
The preferred way to use gomponents is with so-called dot-imports (note the dot before the `gomponents/html` import),
|
||||
|
@ -4,8 +4,8 @@
|
||||
// to the given writer as a string.
|
||||
//
|
||||
// All DOM elements and attributes can be created by using the El and Attr functions.
|
||||
// The functions Text, Textf, Raw, and Rawf can be used to create text nodes.
|
||||
// See also helper functions Group, Map, and If.
|
||||
// The functions Text, Textf, Raw, and Rawf can be used to create text nodes, either HTML-escaped or unescaped.
|
||||
// See also helper functions Group, Map, and If for mapping data to Nodes and inserting them conditionally.
|
||||
//
|
||||
// For basic HTML elements and attributes, see the package html.
|
||||
// For higher-level HTML components, see the package components.
|
||||
|
Loading…
Reference in New Issue
Block a user