[xwiki-devs] [Idea] Look at Thymeleaf as an optional templating language?
See http://www.thymeleaf.org/ With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example. {{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}} Related: * https://dzone.com/articles/template-engines-review-after-deprecated-velocity Thanks -Vincent
Looks like an interesting project, however I'm not sure about how active it is. On github there are 1145 stars whereas the pug templating language has 15820. Just important to avoid jumping from one sinking ship to another ;) https://github.com/thymeleaf/thymeleaf https://github.com/pugjs/pug Thanks, Caleb On 02/01/18 22:48, Vincent Massol wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after-deprecated-velocity
Thanks -Vincent
On 2 Jan 2018, at 23:46, Caleb James DeLisle <[email protected]> wrote:
Looks like an interesting project, however I'm not sure about how active it is. On github there are 1145 stars whereas the pug templating language has 15820.
Just important to avoid jumping from one sinking ship to another ;)
Definitely. Note that my idea here was more of suggesting exploring some other templating languages that would be initially added as a contrib project, rather than replacing Velocity. But you’re perfectly right, if someone is willing to work on this, we might as well pick the right one. However note that pug is not a candidate since it’s not java-based and is for Node.js. Regarding activity https://github.com/thymeleaf/thymeleaf/graphs/contributors shows one active committer. So that’s indeed a bit low (even though there are recent releases). Thanks -Vincent
https://github.com/thymeleaf/thymeleaf https://github.com/pugjs/pug
Thanks, Caleb
On 02/01/18 22:48, Vincent Massol wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after-deprecated-velocity
Thanks -Vincent
Pug has a java implementation: https://github.com/pugjs/pug => java => https://github.com/neuland/jade4j paul On 3 Jan 2018, at 9:47, Vincent Massol wrote:
Just important to avoid jumping from one sinking ship to another ;)
Definitely. Note that my idea here was more of suggesting exploring some other templating languages that would be initially added as a contrib project, rather than replacing Velocity. But you’re perfectly right, if someone is willing to work on this, we might as well pick the right one.
However note that pug is not a candidate since it’s not java-based and is for Node.js.
On 3 Jan 2018, at 09:55, Paul Libbrecht <[email protected]> wrote:
Pug has a java implementation: https://github.com/pugjs/pug => java => https://github.com/neuland/jade4j
Thanks Paul. Doesn’t seem that active either: https://github.com/neuland/jade4j/graphs/contributors BTW there were several other suggestions in the link I gave: https://dzone.com/articles/template-engines-review-after-deprecated-velocity Pebble, Freemarker Freemarker is one that we’ve been wanting to investigate for a long time already: https://freemarker.apache.org/ https://github.com/apache/incubator-freemarker (again mostly one active contributor). We would need to see what it would bring over Velocity for ex. since there’s little point to changing if it doesn’t bring advantages. Thanks -Vincent
paul
On 3 Jan 2018, at 9:47, Vincent Massol wrote:
Just important to avoid jumping from one sinking ship to another ;)
Definitely. Note that my idea here was more of suggesting exploring some other templating languages that would be initially added as a contrib project, rather than replacing Velocity. But you’re perfectly right, if someone is willing to work on this, we might as well pick the right one.
However note that pug is not a candidate since it’s not java-based and is for Node.js.
Note that the code you indicated in you first message cannot work since the {{thymeleaf}} wiki syntax would not be executed. As for the idea in general, supporting as many languages as we can is always interesting. On Wed, Jan 3, 2018 at 11:09 AM, Vincent Massol <[email protected]> wrote:
On 3 Jan 2018, at 09:55, Paul Libbrecht <[email protected]> wrote:
Pug has a java implementation: https://github.com/pugjs/pug => java => https://github.com/neuland/jade4j
Thanks Paul.
Doesn’t seem that active either: https://github.com/neuland/jade4j/graphs/contributors
BTW there were several other suggestions in the link I gave: https://dzone.com/articles/template-engines-review-after-deprecated-velocity
Pebble, Freemarker
Freemarker is one that we’ve been wanting to investigate for a long time already: https://freemarker.apache.org/
https://github.com/apache/incubator-freemarker (again mostly one active contributor).
We would need to see what it would bring over Velocity for ex. since there’s little point to changing if it doesn’t bring advantages.
Thanks -Vincent
paul
On 3 Jan 2018, at 9:47, Vincent Massol wrote:
Just important to avoid jumping from one sinking ship to another ;)
Definitely. Note that my idea here was more of suggesting exploring some other templating languages that would be initially added as a contrib project, rather than replacing Velocity. But you’re perfectly right, if someone is willing to work on this, we might as well pick the right one.
However note that pug is not a candidate since it’s not java-based and is for Node.js.
-- Thomas Mortagne
From the home page it looks very HTML oriented, which is not good for us. I think we need a general purpose templating language that can be used to generate anything (JSON, XML, CSV, etc.) not just HTML.
On Tue, Jan 2, 2018 at 11:48 PM, Vincent Massol <[email protected]> wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after- deprecated-velocity
Thanks -Vincent
On 3 Jan 2018, at 10:01, Marius Dumitru Florea <[email protected]> wrote:
From the home page it looks very HTML oriented, which is not good for us. I think we need a general purpose templating language that can be used to generate anything (JSON, XML, CSV, etc.) not just HTML.
Yes it looks HTML-oriented indeed. However as I mentioned in my initial message, I think that could be a good thing actually. Right now it’s a pain to write UIs in wiki pages because HTML and Velocity don’t play very well together, and wiki syntax is absolutely not great to generate UI). So I see a use case for an HTML-oriented scripting templating language. Note that my goal with this thread was not to suggest a replacement for Velocity. I just saw some twitter post that thymeleaf had just released a new version and since I remembered hearing the name, I thought about mentioning an idea here that it could be interesting to investigate. Right now, I don’t see the issue with Velocity. It’s very simple and stable. Maybe some competitors could have better perfs I don’t know (there are still things we can tune with Velocity I believe). But it would be interesting to list the features/use cases we’d like to see in a new general purpose templating language for XWiki and that Velocity doesn’t support. Thanks -Vincent
On Tue, Jan 2, 2018 at 11:48 PM, Vincent Massol <[email protected]> wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after- deprecated-velocity
Thanks -Vincent
On Wed, Jan 3, 2018 at 11:01 AM, Marius Dumitru Florea < [email protected]> wrote:
From the home page it looks very HTML oriented, which is not good for us. I think we need a general purpose templating language that can be used to generate anything (JSON, XML, CSV, etc.) not just HTML.
Yeah, my first impression was that it looks very similar to JSF, maybe a bit simplified and less configuration needy. Thanks, Eduard
On Tue, Jan 2, 2018 at 11:48 PM, Vincent Massol <[email protected]> wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after- deprecated-velocity
Thanks -Vincent
Well, HTML is what people understand. XSL-FO would not be very widespread. What other language do you want the tempting language to orient itself on? paul On 4 Jan 2018, at 11:24, Eduard Moraru wrote:
On Wed, Jan 3, 2018 at 11:01 AM, Marius Dumitru Florea < [email protected]> wrote:
From the home page it looks very HTML oriented, which is not good for us. I think we need a general purpose templating language that can be used to generate anything (JSON, XML, CSV, etc.) not just HTML.
Yeah, my first impression was that it looks very similar to JSF, maybe a bit simplified and less configuration needy.
Thanks, Eduard
On Tue, Jan 2, 2018 at 11:48 PM, Vincent Massol <[email protected]> wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after- deprecated-velocity
Thanks -Vincent
On Thu, Jan 4, 2018 at 1:35 PM, Paul Libbrecht <[email protected]> wrote:
Well, HTML is what people understand. XSL-FO would not be very widespread.
What other language do you want the tempting language to orient itself on?
None. I want to be able to use the templating language to generate JSON, XML, CSV, etc. i.e. whatever text format I need. For instance I want to generate the live table results JSON using the templating language like I do now with Velocity.
paul
On 4 Jan 2018, at 11:24, Eduard Moraru wrote:
On Wed, Jan 3, 2018 at 11:01 AM, Marius Dumitru Florea < [email protected]> wrote:
From the home page it looks very HTML oriented, which is not good for us. I think we need a general purpose templating language that can be used to generate anything (JSON, XML, CSV, etc.) not just HTML.
Yeah, my first impression was that it looks very similar to JSF, maybe a bit simplified and less configuration needy.
Thanks, Eduard
On Tue, Jan 2, 2018 at 11:48 PM, Vincent Massol <[email protected]> wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after- deprecated-velocity
Thanks -Vincent
On 4 Jan 2018, at 12:47, Marius Dumitru Florea <[email protected]> wrote:
On Thu, Jan 4, 2018 at 1:35 PM, Paul Libbrecht <[email protected]> wrote:
Well, HTML is what people understand. XSL-FO would not be very widespread.
What other language do you want the tempting language to orient itself on?
None. I want to be able to use the templating language to generate JSON, XML, CSV, etc. i.e. whatever text format I need. For instance I want to generate the live table results JSON using the templating language like I do now with Velocity.
What’s the problem with velocity? Thanks -Vincent
paul
On 4 Jan 2018, at 11:24, Eduard Moraru wrote:
On Wed, Jan 3, 2018 at 11:01 AM, Marius Dumitru Florea < [email protected]> wrote:
From the home page it looks very HTML oriented, which is not good for us. I think we need a general purpose templating language that can be used to generate anything (JSON, XML, CSV, etc.) not just HTML.
Yeah, my first impression was that it looks very similar to JSF, maybe a bit simplified and less configuration needy.
Thanks, Eduard
On Tue, Jan 2, 2018 at 11:48 PM, Vincent Massol <[email protected]> wrote:
With this, users could combine HTML and scripting which could be a nice option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after- deprecated-velocity
Thanks -Vincent
On Thu, Jan 4, 2018 at 1:58 PM, Vincent Massol <[email protected]> wrote:
On 4 Jan 2018, at 12:47, Marius Dumitru Florea < [email protected]> wrote:
On Thu, Jan 4, 2018 at 1:35 PM, Paul Libbrecht <[email protected]> wrote:
Well, HTML is what people understand. XSL-FO would not be very widespread.
What other language do you want the tempting language to orient itself on?
None. I want to be able to use the templating language to generate JSON, XML, CSV, etc. i.e. whatever text format I need. For instance I want to generate the live table results JSON using the templating language like I do now with Velocity.
What’s the problem with velocity?
Velocity is a bit slow I think, in any case way slower than executing Java code directly (e.g. if you compare a Java REST resource with its equivalent written in Velocity in a wiki page). Thomas probably knows more. Now I don't know if the other templating engines are faster. Anyway, I was just replying to Paul.
Thanks -Vincent
paul
On 4 Jan 2018, at 11:24, Eduard Moraru wrote:
On Wed, Jan 3, 2018 at 11:01 AM, Marius Dumitru Florea < [email protected]> wrote:
From the home page it looks very HTML oriented, which is not good for us. I think we need a general purpose templating language that can be used
to
generate anything (JSON, XML, CSV, etc.) not just HTML.
Yeah, my first impression was that it looks very similar to JSF, maybe a bit simplified and less configuration needy.
Thanks, Eduard
On Tue, Jan 2, 2018 at 11:48 PM, Vincent Massol <[email protected]> wrote:
With this, users could combine HTML and scripting which could be a
nice
option when using the {{html}} macro for example.
{{html}} {{thymeleaf}} … {{/thymeleaf}} {{/html}}
Related: * https://dzone.com/articles/template-engines-review-after- deprecated-velocity
Thanks -Vincent
participants (6)
-
Caleb James DeLisle -
Eduard Moraru -
Marius Dumitru Florea -
Paul Libbrecht -
Thomas Mortagne -
Vincent Massol