Over time some of my Hugo HTML has gotten a little bit messy… indent/outdent doesn’t match the logic, and I have severe OCD about source code.
I could manually fix all of it, but I was hoping I might find a “pretty printer” that can take the combination of HTML and GO template code and format it nicely. Handling embedded CSS would be a plus, but not a requirement.
I tried to get gofmt running to try that, but the build kept failing with errors and I have no idea why.
Anything out there which would “just work”.
As far as which editor to support: it can be command-line only, but I do use vim and TextMate if solutions there exist.
I also use sublime’s plugin called prettify which also ads space in tag names so than I have to see if it added any space, It would be greater if developer allow spaces for tags like “image” to " image ", as these editors tools add spaces.
For anyone else stumbling to this thread, and if that person is using emacs, the web-mode package works pretty well with GO templates… indentation, commenting, etc.