Hi guys I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore. Stef
I would like to see if there is an XHTML outputer that takes it into account. I will check pillar. Stef On 11/7/14 10:43, stepharo wrote:
Hi guys
I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore.
Stef
Damien I know but I could not find how yet (I just read that fast in less than 5 min) What I would like is the following: I would like to be able to describe menus, page, section for my web site generator. So that we do not have to write everything in Smalltalk to generate a web site. I should check how this is done in marina but it does not like straigh forward with the interaction of the css. Stef
Le 11 juil. 2014 10:50, "stepharo" <stepharo@free.fr <mailto:stepharo@free.fr>> a écrit :
I would like to see if there is an XHTML outputer that takes it into
account.
I will check pillar.
Pillar uses mustache
Am 11.07.2014 um 10:43 schrieb stepharo <stepharo@free.fr>:
Hi guys
I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore.
http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/ Norbert
Thanks I will turn that into a pfte example :) Stef On 11/7/14 10:53, Norbert Hartl wrote:
Am 11.07.2014 um 10:43 schrieb stepharo <stepharo@free.fr <mailto:stepharo@free.fr>>:
Hi guys
I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore.
http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
Norbert
Hi Norbert I'm improving the doc. I added some text on section and others.. And on list with collection I have the following behavior and I do not understand why on string. | templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> #(1 2 3) } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown. Shown too! Shown too! Shown too! ' | templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> '1 2 3' } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown. Shown too! Shown too! Shown too! Shown too! Shown too! ' On 11/7/14 10:53, Norbert Hartl wrote:
Am 11.07.2014 um 10:43 schrieb stepharo <stepharo@free.fr <mailto:stepharo@free.fr>>:
Hi guys
I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore.
http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
Norbert
Stef, {{# â¦} opens a section that can be used to do nested operation. If the value of number is a collection the section is evaluated for every element in the value. #(1 2 3) is a collection of size 3 and '1 2 3' is a collection of size 5 hence the output. A common use case for templates would be something like { 'number' -> { 'value' -> 1. 'value' -> 2. 'value' -> 3 } asDictionary } asDictionary Then you can use a template of {{#number}} value is {{value}} {{/number}} Norbert Am 13.07.2014 um 23:33 schrieb stepharo <stepharo@free.fr>:
Hi Norbert
I'm improving the doc. I added some text on section and others.. And on list with collection I have the following behavior and I do not understand why on string.
| templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> #(1 2 3) } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown.
Shown too!
Shown too!
Shown too! '
| templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> '1 2 3' } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown.
Shown too!
Shown too!
Shown too!
Shown too!
Shown too! '
On 11/7/14 10:53, Norbert Hartl wrote:
Am 11.07.2014 um 10:43 schrieb stepharo <stepharo@free.fr>:
Hi guys
I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore.
http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
Norbert
On 14/7/14 01:22, Norbert Hartl wrote:
Stef,
{{# â¦} opens a section that can be used to do nested operation. If the value of number is a collection the section is evaluated for every element in the value. #(1 2 3) is a collection of size 3 and '1 2 3' is a collection of size 5 hence the output. of course I was thinking that magically you would split the string :) Silly me.
I'm enhancing your blog with more details (I'm reading the mustache doc and your tests). https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/lastSuccess...
A common use case for templates would be something like
{ 'number' -> { 'value' -> 1. 'value' -> 2. 'value' -> 3 } asDictionary } asDictionary
Then you can use a template of
{{#number}} value is {{value}} {{/number}}
Norbert
Am 13.07.2014 um 23:33 schrieb stepharo <stepharo@free.fr <mailto:stepharo@free.fr>>:
Hi Norbert
I'm improving the doc. I added some text on section and others.. And on list with collection I have the following behavior and I do not understand why on string.
| templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> #(1 2 3) } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown.
Shown too!
Shown too!
Shown too! '
| templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> '1 2 3' } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown.
Shown too!
Shown too!
Shown too!
Shown too!
Shown too! '
On 11/7/14 10:53, Norbert Hartl wrote:
Am 11.07.2014 um 10:43 schrieb stepharo <stepharo@free.fr <mailto:stepharo@free.fr>>:
Hi guys
I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore.
http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
Norbert
Stef, thanks for that important work. There is hopefully more to come. The current implementation reflects the mustache spec to a big extent. There are people (like Damien) that would like to see extensions to it. SoI hope I find (some time and) a way to make it extendable while keeping the original spec. Norbert Am 14.07.2014 um 18:52 schrieb stepharo <stepharo@free.fr>:
On 14/7/14 01:22, Norbert Hartl wrote:
Stef,
{{# â¦} opens a section that can be used to do nested operation. If the value of number is a collection the section is evaluated for every element in the value. #(1 2 3) is a collection of size 3 and '1 2 3' is a collection of size 5 hence the output. of course I was thinking that magically you would split the string :) Silly me.
I'm enhancing your blog with more details (I'm reading the mustache doc and your tests).
https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/lastSuccess...
A common use case for templates would be something like
{ 'number' -> { 'value' -> 1. 'value' -> 2. 'value' -> 3 } asDictionary } asDictionary
Then you can use a template of
{{#number}} value is {{value}} {{/number}}
Norbert
Am 13.07.2014 um 23:33 schrieb stepharo <stepharo@free.fr>:
Hi Norbert
I'm improving the doc. I added some text on section and others.. And on list with collection I have the following behavior and I do not understand why on string.
| templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> #(1 2 3) } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown.
Shown too!
Shown too!
Shown too! '
| templateString context | templateString := 'Shown. {{#number}} Shown too! {{/number}}'. context := { 'number' -> '1 2 3' } asDictionary. (MustacheTemplate on: templateString) value: context 'Shown.
Shown too!
Shown too!
Shown too!
Shown too!
Shown too! '
On 11/7/14 10:53, Norbert Hartl wrote:
Am 11.07.2014 um 10:43 schrieb stepharo <stepharo@free.fr>:
Hi guys
I would like to experiment with template for a small web project I have (my web page) and I would like to try mustache. Is there any tutorial? doc? I know that "jose maria aguerra" wrote a tutorial but I cannot find it anymore.
http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
Norbert
I found that. And I'm reading pillar code because I would like to see how I can use a API to generate XHTML and take into account mustache Any real pointer? Stef
On Fri, Jul 11, 2014 at 10:55 AM, stepharo <stepharo@free.fr> wrote:
And I'm reading pillar code because I would like to see how I can use a API to generate XHTML and take into account mustache
pillarString := '! Some text -item1 -item2'. pillarDocument := PRDocumentParser parse: pillarString. htmlString := PRHTMLWriter write: pillarDocument . 'main.template.html' asFileReference mustacheTemplateDuring: [ :template| 'result.html' asFileReference writeStreamDo: [ :outStream | outStream nextPutAll: (template value: { 'contents' -> htmlString } asDictionary) ] ] -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
Thanks Thanks Thanks. I want to check Marina too.
And I'm reading pillar code because I would like to see how I can use a API to generate XHTML and take into account mustache
pillarString := '! Some text
-item1 -item2'.
pillarDocument := PRDocumentParser parse: pillarString.
htmlString := PRHTMLWriter write: pillarDocument .
'main.template.html' asFileReference mustacheTemplateDuring: [ :template|
'result.html' asFileReference writeStreamDo: [ :outStream |
outStream nextPutAll: (template value: { 'contents' -> htmlString } asDictionary)
]
]
participants (3)
-
Damien Cassou -
Norbert Hartl -
stepharo