Is there a template engine in Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a template engine in Pharo

Damien Cassou
Hi,

I'm looking for a template engine for Pharo. What I mean by that is
the same as String>>format: but much more powerful.

Thanks

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

NorbertHartl

Am 27.11.2013 um 13:21 schrieb Damien Cassou <[hidden email]>:

Hi,

I'm looking for a template engine for Pharo. What I mean by that is
the same as String>>format: but much more powerful.

Be my guest


Norbert


Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

Damien Cassou
On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <[hidden email]> wrote:
> Be my guest
>
> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/


thank you Norbert, that's really useful.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

Tudor Girba-2
Indeed, it is quite nice.

Doru


On Wed, Nov 27, 2013 at 2:03 PM, Damien Cassou <[hidden email]> wrote:
On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <[hidden email]> wrote:
> Be my guest
>
> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/


thank you Norbert, that's really useful.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill




--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

NorbertHartl
In reply to this post by Damien Cassou

Am 27.11.2013 um 14:03 schrieb Damien Cassou <[hidden email]>:

> On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <[hidden email]> wrote:
>> Be my guest
>>
>> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
>
>
> thank you Norbert, that's really useful.
>
I would be glad if you would use it. If the additional emitted whitespaces are annoying to you drop me a note. I now postpone the implementation of the whitespace for too long anyway.

Norbert


Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

Esteban A. Maringolo
Did you try to build JSON responses with this templating solution?

Regards!

Esteban A. Maringolo


2013/11/27 Norbert Hartl <[hidden email]>

Am 27.11.2013 um 14:03 schrieb Damien Cassou <[hidden email]>:

> On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <[hidden email]> wrote:
>> Be my guest
>>
>> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
>
>
> thank you Norbert, that's really useful.
>
I would be glad if you would use it. If the additional emitted whitespaces are annoying to you drop me a note. I now postpone the implementation of the whitespace for too long anyway.

Norbert



Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

NorbertHartl


Am 28.11.2013 um 00:21 schrieb "Esteban A. Maringolo" <[hidden email]>:

Did you try to build JSON responses with this templating solution?

No, I didn't. Only xml so far.

Norbert
Regards!

Esteban A. Maringolo


2013/11/27 Norbert Hartl <[hidden email]>

Am 27.11.2013 um 14:03 schrieb Damien Cassou <[hidden email]>:

> On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <[hidden email]> wrote:
>> Be my guest
>>
>> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
>
>
> thank you Norbert, that's really useful.
>
I would be glad if you would use it. If the additional emitted whitespaces are annoying to you drop me a note. I now postpone the implementation of the whitespace for too long anyway.

Norbert



Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

Tudor Girba-2
Hmm. What exactly does it mean to build XML/JSON responses out of the template?

Doru


On Thu, Nov 28, 2013 at 8:13 AM, Norbert Hartl <[hidden email]> wrote:


Am 28.11.2013 um 00:21 schrieb "Esteban A. Maringolo" <[hidden email]>:

Did you try to build JSON responses with this templating solution?

No, I didn't. Only xml so far.

Norbert

Regards!

Esteban A. Maringolo


2013/11/27 Norbert Hartl <[hidden email]>

Am 27.11.2013 um 14:03 schrieb Damien Cassou <[hidden email]>:

> On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <[hidden email]> wrote:
>> Be my guest
>>
>> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
>
>
> thank you Norbert, that's really useful.
>
I would be glad if you would use it. If the additional emitted whitespaces are annoying to you drop me a note. I now postpone the implementation of the whitespace for too long anyway.

Norbert






--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Is there a template engine in Pharo

NorbertHartl

Am 28.11.2013 um 10:37 schrieb Tudor Girba <[hidden email]>:

Hmm. What exactly does it mean to build XML/JSON responses out of the template?

It is the same as for any other template, too. You have a prepared document at hand where you can replace the placeholders with real values. Doing this for a structured response is surely not a good idea. Generating the response in a structured way is more reliable and has less potential for the usual traps.
But there is a threshold when the complexity of the response structure is far bigger then the needed diversity of requests/responses. In those cases building a structure that can properly generate a request or response if you only need a simple things would be overkill. 
I generate SOAP requests. SOAP is utterly complex and the ratio of gain/complexity is really really small. The API we have to deal with is complex, too. And we need only a handful calls from the whole API. So I hope you can see that there are reasons to take a less clever approach. And it is a approach I can do with pharo ;)

Norbert

On Thu, Nov 28, 2013 at 8:13 AM, Norbert Hartl <[hidden email]> wrote:


Am 28.11.2013 um 00:21 schrieb "Esteban A. Maringolo" <[hidden email]>:

Did you try to build JSON responses with this templating solution?

No, I didn't. Only xml so far.
Norbert

Regards!

Esteban A. Maringolo


2013/11/27 Norbert Hartl <[hidden email]>

Am 27.11.2013 um 14:03 schrieb Damien Cassou <[hidden email]>:

> On Wed, Nov 27, 2013 at 1:42 PM, Norbert Hartl <[hidden email]> wrote:
>> Be my guest
>>
>> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
>
>
> thank you Norbert, that's really useful.
>
I would be glad if you would use it. If the additional emitted whitespaces are annoying to you drop me a note. I now postpone the implementation of the whitespace for too long anyway.

Norbert






--

"Every thing has its own flow"