Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liquid markup in Java/Scala

I'm looking analogs for Rails Liquid markup! in Java or Scala languages. Which markup exists like liquid?

like image 234
Timothy Klim Avatar asked Mar 20 '12 09:03

Timothy Klim


4 Answers

Scalate Mustache

May do the trick, offers pre-compilation, and "codeless" templates (although I am not sure if the security requirement of Liquid is fully met).

At any rate, check it out, the Scalate template engine itself is quite powerful (jade, scaml, etc.)...

like image 112
virtualeyes Avatar answered Nov 09 '22 08:11

virtualeyes


I was also looking for a java implementation of Liquid, and found this: https://github.com/bkiers/Liqp

According to the author, Liqp is:

An ANTLR based 'Liquid Template' parser and rendering engine.

like image 41
João Paulo Mafra Avatar answered Nov 09 '22 06:11

João Paulo Mafra


You should also take a look at Handlebars.java.

You can make Helpers to emulate Liquid's filters:

Liquid:

 {{ context | markdownify }}

Handlebars.java:

 {{md context}}
like image 35
Adam Gent Avatar answered Nov 09 '22 06:11

Adam Gent


The most similar I can think of is probably Jangod. I guess you be able to use Liquid directly with the help of JRuby. Alternatively you can use some classic markup format like Velocity or Freemarker. Another suggestion that I haven't personally tried would be Mustache.java.

like image 41
Bozhidar Batsov Avatar answered Nov 09 '22 07:11

Bozhidar Batsov