Question

In Scalate manual for Scaml and Jade it's stated that there two options ScamlOptions.nl and ScamlOptions.indent that can be used to minify outputted HTML. What is also stated is "You will need to configure these before any of your scaml templates are compiled as they affect the generated scala template classes.". I tried to use these options in two different ways in my Scalatra project using Jade for templates:

  1. Added ScamlOptions.nl="" and ScamlOptions.indent="" to build.scala in my Scalatra project and respective dependencies to plugins.sbt. Then removed all from target directory, recompiled build.scala and all template sources. Didn't help.
  2. Added the same lines directly to the servlet where respective get("/") rule is inserted. However this doesn't seem to be a good idea because properties are set after compiling the code. No result.

Was somebody able to use these options within Scalatra project or independenly? Probably my error is related to sbt cache because sometimes I see minified HTML outputted while starting application under built-in Jetty server but this is not regular that's why I'm asking. It would be great if someone could provide an exact sequence of steps how to fix this.

Was it helpful?

Solution

I've got the same problem. I think it's a bug.
Ticket raised: https://www.assembla.com/spaces/scalate/tickets/300

Edit: Scalate 1.7.0 was recently released. I tried it out and the issue is fixed!

OTHER TIPS

Well, Im running into this too.

Bootstrapped via Embedded Jetty, ScamlOptions.indent actually works as expected. However once packeged into a Jar, it does not. Something is nuking the changes to ScamlOptions with defaults I think.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top