# htmlformat htmlformat is a Go package and CLI tool used to format HTML. It is forked and simplified from the https://github.com/ericchiang/pup package. It does not aim to: * Colorize output. * Modify the input HTML except for formatting (i.e. no HTML escaping will be applied). * Provide any facilities to query the content. ## Installation To use the CLI, you can install with Go > 1.20. ``` go install alin.ovh/htmlformat/cmd/htmlformat@latest ``` ## Usage ### CLI ```bash echo '
  1. A
  2. B
' | htmlformat
  1. A
  2. B
``` ### Package ```go r := strings.NewReader(`
  1. A
  2. B
`) w := os.Stdout if err := Fragment(w, r); err != nil { log.Fatalf("failed to format: %v", err) } ```