Is there a function that converts from simple HTML to a Hamlet structure?

I am starting to use the Yesod web framework. I have an existing HTML code template that I would like to automatically translate to the Hamlet code structure. Is there any way to do this?

+5
source share
1 answer

Here is a solution that can do most of the work.

perl -pe 'chomp' test.html | xmllint --format --encode UTF-8 - | perl -pe 's#</[^>]+>##g'

from https://github.com/yesodweb/yesod/wiki/Hamlet

+2
source

All Articles