Skip to content

benpate/html

Repository files navigation

html 🚧

GoDoc Version Build Status Go Report Card Codecov

Efficient HTML Tag Assembly

This library builds a string buffer of HTML tags programmatically.

b := html.New()

b.Div().Class("wrapper")
b.Div().Class("inner")
b.Form().Attr("action", "my-server")
b.Input().Name("FullName").Value("John Connor").Close()
b.Input().Name("Email").Value("john@connor.mil").Close()
b.CloseAll()
b.String()

Why Builder?

Why not just use Go Templates instead? Templates work great in many cases, but they can be cumbersome when building complex conditional logic directly in your code. Builder uses an efficient strings.Builder to assemble the exact HTML you need, and nothing extra.

Pull Requests Welcome

This library is growing rapidly, as the requirements of its downstram projects continue to evolve. How can it help you build your next masterpiece? Add your voice, because we're all in this together! 🚧

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages