Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using HAML, Scaml or Jade with Play

Is it possible to use Haml (or similar tempting languages like Scaml or Jade) in Play views?

like image 861
Bill Avatar asked Jun 10 '12 14:06

Bill


2 Answers

Try using the Scalate, template engine.

like image 111
Kevin Sjöberg Avatar answered Nov 05 '22 13:11

Kevin Sjöberg


Well I am unsure if anyone had any luck on this. So let me share what I did.

I am using play 2.1.1 with scala. Integrating Play (Scala) with Jade is a pain.

If you are comfortable with haml, Jade is probably the closest to it.

The integration of play 2.* with jade isn't that great, especially if you are working with sbt. Installing scalate is a bit of an overkill as it is pretty heavy weight. I used a Java library called Jade4J which is written in Java.

You can see my solution here .. pretty clean and easy.

There are some plugins like play2-scalate which might help you but they get the whole scalate library which is not really required. Hope this helps. Cheers

like image 21
Geet Chandratre Avatar answered Nov 05 '22 14:11

Geet Chandratre