jbake-org / jbake

Java based open source static site/blog generator for developers & designers.
http://jbake.org
MIT License
1.12k stars 326 forks source link

Support Rythm Template Engine #228

Open helmbold opened 9 years ago

helmbold commented 9 years ago

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>
jonbullock commented 8 years ago

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

helmbold commented 8 years ago

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

jonbullock commented 8 years ago

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

helmbold commented 8 years ago

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

jonbullock commented 8 years ago

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

Ali96kz commented 6 years ago

Is this issue still actual?

helmbold commented 6 years ago

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

manikmagar commented 6 years ago

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.

helmbold commented 6 years ago

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

Ali96kz commented 6 years ago

How can I inject it as plugin?

helmbold commented 6 years ago

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.