2025-10-07 03:01:25 +02:00
|
|
|
# HTML
|
|
|
|
|
|
|
|
|
|
Package html provides functions for programmatically composing and rendering HTML and HTML templates.
|
|
|
|
|
|
|
|
|
|
Docs: https://godocs.io/code.squareroundforest.org/arpio/html
|
2025-10-07 17:22:48 +02:00
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
"code.squareroundforest.org/arpio/html"
|
|
|
|
|
. "code.squareroundforest.org/arpio/html/tag"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
html.RenderIndent(
|
|
|
|
|
os.Stdout,
|
|
|
|
|
html.Indent(),
|
|
|
|
|
Html(
|
|
|
|
|
Head(Title("Hello, world!")),
|
|
|
|
|
Body(
|
|
|
|
|
H1("Hello, world!"),
|
|
|
|
|
P("This a sample HTML page."),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
```
|