Questions tagged [scalate]

Scalate is a Scala based template engine for generating text and markup using the following template formats: Mustache, Scaml, Jade, and SSP.

Scalate is a Scala 2.8 based template engine for generating text and markup which can be used in the following frameworks and environments:

Scalate supports the following template formats

  • Mustache which is a Scala dialect of Mustache for logic-less templates which also work inside the browser using mustache.js
  • Scaml which is a Scala dialect of Haml and is very DRY for generating HTML / XHTML
  • Jade which is an even more DRY dialect of Scaml for HTML / XHTML markup generation
  • SSP which is like Velocity, JSP or Erb from Rails

Scalate also has a powerful web console and command line shell which includes converters from JSP or HTML to Scalate

Still confused? Check out which template engine is right for me, why Scalate or how Scalate compares to JSP or Lift

72 questions
3
votes
1 answer

scalate does not compile templates in tomcat

I am trying to make scalate work under tomcat, but it crashes when it tries to compile the scaml templates. No problem with Jetty. I am new to this and tomcat in general. It seems also the scalatra-sbt prototype on github crashes, which makes me…
flagZ
  • 67
  • 7
3
votes
2 answers

Loop over java Map with scalate's mustache implementation

Can mustache loop over a java Map? My object: Map mapTest Tried this in my mustache template: {{#mapTest}} {{.}} {{/mapTest}} That spits out a string representation (mapTest.toString()) of the entire object but doesn't loop at…
devth
  • 2,738
  • 4
  • 31
  • 51
3
votes
1 answer

Is scalate template size limited to 64k?

Trying to include bunch of HTML is a SSP template, I've got the following exception: Caused by: java.lang.IllegalArgumentException: null at scala.tools.asm.ByteVector.putUTF8(ByteVector.java:213) at…
Alexey Kalmykov
  • 1,958
  • 2
  • 15
  • 27
3
votes
2 answers

How to interpret SBT error messages

Doing some work in scalatra, and when running ./sbt, I'm seeing this error message: [trace] Stack trace suppressed: run last compile:sources for the full output. [error] (compile:sources) org.fusesource.scalate.InvalidSyntaxException: `val' expected…
Alex Spangher
  • 977
  • 2
  • 13
  • 22
3
votes
1 answer

JADE/SCALATE template error - InvalidSyntaxException

I'm trying out Jade (via Scalate) and am running into an error that I'm not finding an answer to. (Or, at least not seeing.) I mocked up a form using BlueGriffon (it's been years since I've coded HTML...) and placed the resultant HTML into Aarron…
mjk
  • 659
  • 1
  • 9
  • 20
2
votes
2 answers

How do I specify an HTML5 Doctype format in Scalate for Scaml?

I'm using Scalatra's built-in Scalate support but I want my default.scaml layout to render an HTML5 Doctype. The Scalate documentation states When the format option is set to :html5, !!! is always but I can't find anyone saying…
Cole Stanfield
  • 2,437
  • 2
  • 19
  • 12
2
votes
1 answer

scaml "illegal nesting" error

Hi I'm a total Noob at scalate/scaml (I tagged haml since scaml & haml are similar). I have some template that looks like this: -@ var customer : com.x.model.Customer !!! %html %body %p Contact: %a{:href =>…
Kevin
  • 24,871
  • 19
  • 102
  • 158
2
votes
3 answers

Is there are any lift + scalate full example?

There are hello scalate example, but it's too simple to learn. I want to know how integirat lift and scalate, for example, lift comet, lift form ...
Orna
  • 21
  • 1
2
votes
1 answer

How to add style sheets in Scalate with Jade syntax

I want to know how to include stylesheets in Scalate (1.7.1) using the Jade syntax. The user guide mention something about layouts, but it isn't shown in the Jade documentation and its quite cryptic to understand. I tried -include. It complains…
user1187135
2
votes
0 answers

How to share a mustache template between Scalate and Javascript?

So I'm using some server-side mustache templates with Scalatra and Scalate, and I'd like to use them in my Javascript code too. Ideally I can load the same templates via some sort of ajax call, but I'm not really sure how to set that up with…
Matthew Rathbone
  • 8,144
  • 7
  • 49
  • 79
2
votes
2 answers

Scalate TemplateException with Play 2.2.1

I'm trying to use Scalate 1.6.1 with Play, but it gives me this: [TemplateException: scala.reflect.internal.TreeInfo.firstArgument(Lscala/reflect/internal/Trees$Tree;)Lscala/reflect/internal/Trees$Tree;] in this code in the…
LowFieldTheory
  • 1,722
  • 1
  • 26
  • 39
2
votes
1 answer

play2-scalate publish-local error

I am trying to use the play2-scalate plugin (https://github.com/adetante/play2-scalate) to leverage Jade templates in my Play framework app, but have encountered an error when trying to run 'play publish-local'. Before I file an issue, I thought I'd…
mavarley
  • 41
  • 5
1
vote
1 answer

how can I pass attribute from sprint to scalate template?

I'm learning scalate template engine. How can I pass an object (for example User) from my controller to template .ssp in my scalate template ? my controller @RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale,…
Fixus
  • 4,631
  • 10
  • 38
  • 67
1
vote
0 answers

Install Scalate in Play (Scala)

I was following the instructions here to install scalate for my project http://www.playframework.org/modules/scalate-0.1/home And here's a controller from my app package controllers { import play._ import play.mvc._ object Home extends…
trivektor
  • 5,608
  • 9
  • 37
  • 53
1
vote
2 answers

Scalate sbt 0.11.0 plugin help

I'm developing a Scalatra web app with Scalate Jade and using sbt 0.11.0 I've been packaging the web app with "com.github.siasia" %% "xsbt-web-plugin" % "0.1.2". I've also been experimenting with "com.zentrope" %% "xsbt-scalate-precompile-plugin" %…
torrens
  • 163
  • 5