mwunsch / handlebars.scala

A Scala implementation of the Handlebars templating language (a superset of Mustache).
Apache License 2.0
112 stars 40 forks source link

fix issue #49 #50

Open tomatohf opened 9 years ago

tomatohf commented 9 years ago

Hi Mark,

We have used your great Scala implementation of Handlebars in our product qiaobutang.com , and we'd like to join to make it better ~ :-)

BTW, it's glad to extend the Binding interface, we implemented a new Binding to fill json format values and avoid runtime reflection.

timcharper commented 9 years ago

@tomatohf I'm glad to hear you used the Binding interface; I was responsible for those changes and have recently submitted a pull-request to include my play-json integration: https://github.com/SpinGo/handlebars.scala/commit/4a7483460122bfab30fac8a5d1b3340d08f599d7

With which JSON library did you integrate?

Being able to bind to a JSON AST allowed us to seamlessly render handlebars templates in both JS land and Scala land, and it worked out relatively well.

Nice catch on your fix, BTW.

tomatohf commented 9 years ago

@timcharper We integrated lift-json. And we are also using handlebars as templates in both JS and Scala.

timcharper commented 9 years ago

Great; do you have the code somewhere? I could help review it and get it ready for merge. The play-json integration was merged into handlebars primary.

tomatohf commented 9 years ago

I have the code in our private github repository. It seems there would be another pull request ? If so, could you please point me out where to put the code. Or, other way preferred?

timcharper commented 9 years ago

You could just post a gist

Sent from my iPhone

On Sep 1, 2015, at 08:18, Tomato notifications@github.com wrote:

I have the code in our private github repository. It seems there would be another pull request ? If so, could you please point me out where to put the code. Or, other way preferred?

— Reply to this email directly or view it on GitHub.

tomatohf commented 9 years ago

I just found play-json under the addon folder ...

tomatohf commented 9 years ago

ok, I will add a gist

tomatohf commented 9 years ago

Here it is => https://gist.github.com/tomatohf/e54bc169da2a2425343f

timcharper commented 8 years ago

Well, lol here we are 5 months later!

I merged your gist and made a few modifications to it; it's here: https://github.com/mwunsch/handlebars.scala/tree/lift-json

Could you write some tests for it? Just mimic the tests for the play-json bindings. Then we'll be good to merge it in.

Thanks!

tomatohf commented 8 years ago

Sure, I'm glad to add some tests just like what play-json bindings does in addons directory. While would it be better do that in a new pull request based on the lift-json branch?

timcharper commented 8 years ago

@tomatohf sure! Pull request to lift-json branch would be optimal. Or, you could just amend the commit from the lift-json branch and send a pull request for master.