Skip to content

A simple library to write HTML in plain Go. No extra build step.

License

HypercommitHQ/libhtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libhtml

Simple HTML library for Go.

Install

go get github.com/hypercodehq/libhtml

Usage

package main

import (
	"net/http"

	"github.com/hypercodehq/libhtml"
	"github.com/hypercodehq/libhtml/attr"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		doc := html.Document(
			html.HTML(
				html.Head(html.Title(html.Text("Hello"))),
				html.Body(html.H1(html.Text("Hello, World!"))),
			),
		)
		doc.Render(w, r)
	})
	http.ListenAndServe(":8080", nil)
}

About

A simple library to write HTML in plain Go. No extra build step.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages