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?
Asked
Active
Viewed 466 times
5
-
What are the types of your existing code? – Joachim Breitner Mar 12 '13 at 22:30
-
Plain HTML, for example, those taken from templates, with JS and CSS – Invoke Mar 19 '13 at 19:59
-
I'm not sure, but maybe this could help you [link](http://hackage.haskell.org/packages/archive/html/latest/doc/html/Text-Html.html#t:HTML), seems to have some kind of parsers – Jcao02 May 19 '13 at 03:43
1 Answers
2
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'

yogsototh
- 14,371
- 1
- 22
- 21