Programatically Generating HTML

I like libraries that let you programatically generate html documents. For example, Go's x/net/html:

I like libraries that let you programatically generate html documents. For example, Go's x/net/html:

https://gist.github.com/HalCanary/61276afbab042e204e54268f6a42f065

func main() {
	html.Render(os.Stdout,
		HtmlDocument(
			&html.Node{Type: html.DoctypeNode, Data: "html"},
			Element("html",
				Attr{"lang": "en"},
				Elem("head",
					Comment("HELLO WORLD"),
					Element("meta", Attr{"charset": "utf-8"}),
					Element("meta", Attr{
						"name": "viewport", "content": "width=device-width, initial-scale=1.0"}),
					Elem("title", TextNode("HELLO WORLD")),
					Elem("style", TextNode("body{max-width:35em;margin:22px auto 64px auto;padding:0 8px;}")),
				),
				Elem("body",
					Elem("h1", TextNode("HELLO!")),
					Elem("p", TextNode("world")),
				),
			),
		),
	)
}