What is the recommened library to minify/prettify HTML output of Hakyll?

There is a compressor for css but I can’t find any for HTML.

There are some external non-Haskell tools around and I might be able to use it like this.

However, since Haskell have lots of parser for HTML already, I would like to use this task as learning opportunity.

1 Like

I don’t know of any libraries that do this. I can think of a couple workarounds though:

  1. You could try to get the actual HTML output from Hakyll before it gets converted into a string (or Text or ByteString or whatever). Then you could write your own renderer (or maybe reuse an existing one) that produces minified HTML.

  2. If Hakyll doesn’t expose the HTML before rendering it, you could parse the string output and then pass it through the above mentioned renderer.

1 Like