jbake icon indicating copy to clipboard operation
jbake copied to clipboard

Support Rythm Template Engine

Open helmbold opened this issue 9 years ago • 11 comments

The Rythm Template Engine is inspired by Microsofts Razor template engine with a nice, concise syntax. It would be nice if jbake would support Rythm.

Example:

<ul>
    @for(Product product: products) {
        <li>@product.getName(). Price: @product.getPrice().format("## ###,00") €</li>
    }
</ul>

helmbold avatar Sep 01 '15 19:09 helmbold

Thanks for suggesting the template engine, have you had much experience using it?

jonbullock avatar Apr 26 '16 21:04 jonbullock

I wouldn't call myself a Rythm expert, but I've used it in several projects and was pretty satisfied with it.

helmbold avatar Apr 28 '16 10:04 helmbold

Are any of those projects public so I can have a look at a real world usage example?

jonbullock avatar Jun 04 '16 10:06 jonbullock

Unfortunately not, it was all internal stuff. But it's not a big deal to setup Rythm and try it.

helmbold avatar Jun 06 '16 06:06 helmbold

Ah no problem, I was going to check it supports everything JBake needs.

jonbullock avatar Jun 06 '16 21:06 jonbullock

Is this issue still actual?

Ali96kz avatar Apr 27 '18 16:04 Ali96kz

I still think that the Rythm template would be a nice improvement.

helmbold avatar Apr 30 '18 11:04 helmbold

I haven't used Rythm but in general, it will always be good to support various templates. As of now, all parser engines are part of core functionality. Adding a new parser means a change in the core. I believe as a part of plugin discussions, it was discussed that we should probably extract out the parser engines so that they can be implemented independent of core jbake and injected as a plugin/extension.

manikmagar avatar Apr 30 '18 14:04 manikmagar

Just for inspiration: take a look at clean architecture. A template engine should be a plug-in.

helmbold avatar May 04 '18 09:05 helmbold

How can I inject it as plugin?

Ali96kz avatar May 05 '18 08:05 Ali96kz

A template engine plugin would be an implementation of a TemplateEngine interface. This could be injected like any other implementation of an interface with a dependency container. But in this case what gets injected would depend on some user configuration. Another way could be a ServiceLoader approach. That would even allow to add new template engines without recompiling jbake.

helmbold avatar May 17 '18 12:05 helmbold