Skip to content

aidenlabx/htmlgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

htmlgo

htmlgo is a fluent HTML builder for Go.

Install

go get github.com/aidenlabx/htmlgo@latest

Quick start

package 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())
}

Example

Run the bundled example:

go run ./examples/basic

License

This project is licensed under the MIT License. See LICENSE for details.

About

A fluent Go HTML builder with escaping, chainable APIs, and HTML5 helpers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages