Add various hamlet features to xml-hamlet#91
Conversation
|
Thanks for doing this. This is a large PR and will take me some time to review. That said: I'm no longer actively using or maintaining xml-hamlet. If you'd be interested in stepping in as a comaintainer, I'd be happy to share upload rights to Hackage if you'd like to maintain this going forward. A cursory review of the patch looks good BTW. |
|
Thanks! I had never used xml-hamlet before yesterday, so I'm not sure I'm ready to take on maintainance, but if I do continue to find uses for it I will certainly consider it. (My coworker new to haskell did say "[XML template] looks better than java/ruby analogs", so there's hope.) Happy to iterate if you have any comments on this PR otherwise. |
|
I just tested this out on a piece of XML hamlet code I wrote recently: I received the error message: This looks related to yesodweb/shakespeare#200, which unfortunately was a bug that slipped in just before you did this refactoring I think. |
Basically merge in various additions to Hamlet to add support for
bindings <-, $case, and *{attributes}. Most of the code is
(unfortunately) copied from Text.Hamlet and Text.Hamlet.Parse
from shakespeare/2.0.12.1.
|
Updated to match shakespeare/2.0.12.1 (two line change at XMLParse.hs:190), added matching test case, and added specific version in commit message, to help with future merging. I'll now watch the shakespeare repo for future updates as well. |
|
Thanks for the quick turnaround here! Just doing a few more sanity checks. |
|
Thank you! |
This adds support for fancy
bindings <-,$case, and*{attributes}to xml-hamlet. (The docs suggest these should exist already.) I basically went through and merged pieces of Text.Hamlet.Parser into XMLParser, and Text.Hamlet into XML. I believe I managed to avoid all the pieces that are specific to HTML/don't apply to XML. Added a few test cases to match (though nothing near what hamlet has). In my mind, the questionable pieces are:ToAttributes, for which I debated using the existing Text.Hamlet class, though that would disallow XML Names, andI should also note that this is copying MIT-licensed code into BSD3, though @snoyberg owns both.