Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a function that transform from plain HTML to Hamlet structure?

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

like image 446
Invoke Avatar asked Nov 03 '22 02:11

Invoke


1 Answers

Here is a solution which might 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

like image 188
yogsototh Avatar answered Nov 15 '22 07:11

yogsototh