HTML generation DSL for Go
Go to file
Brandon Dyck 5db387ffae Logged module change 2023-12-20 15:39:21 -07:00
attribute Move module to git.codemonkeysoftware.net 2023-12-20 15:35:09 -07:00
element Move module to git.codemonkeysoftware.net 2023-12-20 15:35:09 -07:00
internal/codegen Move module to git.codemonkeysoftware.net 2023-12-20 15:35:09 -07:00
.gitlab-ci.yml Check more stuff in CI 2019-04-17 21:06:01 -06:00
CHANGELOG.md Logged module change 2023-12-20 15:39:21 -07:00
COPYING Added license and readme 2019-04-17 22:32:53 -06:00
README.md Move module to git.codemonkeysoftware.net 2023-12-20 15:35:09 -07:00
attribute types.txt Added notes on attributes 2019-06-13 19:55:45 -06:00
benchmark_test.go Move module to git.codemonkeysoftware.net 2023-12-20 15:35:09 -07:00
ci_check Check more stuff in CI 2019-04-17 21:06:01 -06:00
defs.json Get rid of custom comment generation 2019-08-27 16:59:59 -06:00
go.mod Move module to git.codemonkeysoftware.net 2023-12-20 15:35:09 -07:00
go.sum Escape entities in Text and Attrib 2019-04-28 22:03:39 -06:00
hatmill.go Make boolean attributes more useable 2020-05-25 15:18:17 -06:00
hatmill_test.go Move module to git.codemonkeysoftware.net 2023-12-20 15:35:09 -07:00

README.md

hatmill - HTML generation DSL for Go

License Gitlab pipeline status Go Report Card GoDoc Badge count

hatmill provides a simple set of types and helper functions for writing HTML in plain Go code, without having to deal with any template languages. It is not spectacularly fast, but is comparable in simple cases to the html/template package; run go test -bench=. -benchmem for proof. hatmill “templates” are arguably easier to read and write than many template languages.

hatmill uses semantic versioning.

Installation

There are three necessary packages:

  • git.codemonkeysoftware.net/b/hatmill
  • git.codemonkeysoftware.net/b/hatmill/attribute
  • git.codemonkeysoftware.net/b/hatmill/element

Install them as you would any other Go package, with go get or whatever. git.codemonkeysoftware.net/b/hatmill is a Go module and so will play nicely with Go ≥ 1.11.

Usage

Basic types are in git.codemonkeysoftware.net/b/hatmill. The attribute and element subpackages contain helper functions for HTML5 attributes and elements. See the Example function in hatmill_test.go.

Hacking

If there is a missing attribute or element helper function, describe it in defs.json and run go generate in the repository root. If you can't figure out what you need to know by reading defs.json, internal/codegen/*, attribute/*, and element/*, then pester me to improve the documentation.