htmlgo is a fluent HTML builder for Go.
go get github.com/aidenlabx/htmlgo@latestpackage main
import (
"fmt"
"github.com/aidenlabx/htmlgo"
)
func main() {
page := htmlgo.HTML5(
htmlgo.Head(
htmlgo.Title(htmlgo.Text("Demo")),
),
htmlgo.Body(
htmlgo.Div().
ID("app").
AddClass("container").
Style("padding: 16px").
Text("Hello <world>"),
),
)
fmt.Println(page.String())
}Run the bundled example:
go run ./examples/basicThis project is licensed under the MIT License. See LICENSE for details.