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
1
vote
1 answer

Cannot resolve errors for Scalatra project in Intellij IDEA IDE

Im using IntelliJ Idea IDE for working on a scalatra project i created using giter8.I use sbt to run the project.When i open the project in IntelliJ , i get the following errors in MyScalatraServlet.scala: Cannot resolve symbol scalate Cannot…
user897305
1
vote
1 answer

Apache Camel web console's scalate servlet fails in WebLogic

I've found a similar issue described in detail in the scala mailing list (also here). It seems to be related to this change in classpath management when creating scala interpretation environments. In my case both scala-library and scala-compiler are…
dm3
  • 2,038
  • 2
  • 17
  • 20
1
vote
1 answer

how to use scalate with scalatra

Hi Iam developing a application with Scalatra.I would like to use scalate to render the pages using the template. Are there any blogs or pointers to combine scaml and scala code.
prassee
  • 3,651
  • 6
  • 30
  • 49
1
vote
1 answer

Scalatra - not found: object scalate

Context: I'm looking to pick up Scalatra for the first time. I'm following instructions from Scalatra In Action as well as the sample code repo provided. I'm able to get a template project created using g8. When I update the code in the…
emalcolmb
  • 1,585
  • 4
  • 18
  • 43
1
vote
1 answer

scaml interpolation in html attributes

I have something like this: -@ var id:String %div{:dojoType => 'dojo.data.ItemFileReadStore', :jsType => 'store', :url => "/path/to/resource?id=#{id}"} I was hoping variable interpolation would work here, but it just puts #{id} into the html. I…
Kevin
  • 24,871
  • 19
  • 102
  • 158
1
vote
1 answer

scalate/scaml layout not applied

I've followed the user manual to apply a default template, e.g. in the projects src/main/webapp/WEB-INF/scalate/layouts/default.scaml I have a template that's supposed to get applied to all scaml files, but when I hit my test page (in…
Kevin
  • 24,871
  • 19
  • 102
  • 158
1
vote
1 answer

Scala Templates: Map a String to a Template

I use Scalate for templating. Usually it goes this way: Template: Hello {{name}} Parameters: `Map("name" -> "Peter") Result: Hello Peter Is there a way to get the Parameter Map as Result? Template: Hello {{name}} Request: Hello…
pme
  • 14,156
  • 3
  • 52
  • 95
1
vote
0 answers

Scalate SSP fails on certain if blocks

Consider the following dummy SSP file: #{ val testMap1 = Map("a" -> true, "b" -> true, "c" -> true) val testMap2 = Map("d" -> false, "e" -> false, "f" -> true) val something = true val value =…
Gx1sptDTDa
  • 1,558
  • 2
  • 11
  • 23
1
vote
0 answers

Setup Scalate in Play Framework 2.3.x

Background I am working on a project using Play Framework 2.3.4. I found the Twirl template engine great, but Scalate is even better. However, the instructions of setting up Scalate in Play Framework are outdated. I am not able to have it…
Gavin
  • 4,458
  • 3
  • 24
  • 37
1
vote
0 answers

How to pass in object definition body to a function

My goal is to DRY up the repetitive parts of the definition of objects passed to a generic function in the following block of code: renderTpl(response, "person.html", new Transformer { $(".person :first-child").contents = name $(".person…
Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
1
vote
0 answers

Swagger code generation using scalate: format not as expected

I am using Swagger codegen to generate REST client APIs. I have a supporting class that uses a mustache file that looks like this: package {{package}}; import {{apiPackage}}.*; public class MyClient { private final String basePath, token; …
Giovanni Botta
  • 9,626
  • 5
  • 51
  • 94
1
vote
1 answer

change my application that works with mongodb on mongolab

I am working on Eclipse with a small scala/scalatra application.. at first I worked with mongodb installed on eclipse (locally) my application is running and everything is good but when I wanted to deploy my application on heroku I found http 503…
yotta
  • 35
  • 4
1
vote
0 answers

Is it possible to define a macro in Scala ssp template?

I've searched a lot, but didn't find anything. Is there any way to define a macro in Scala ssp and other Scalate templates to recursively call it in the template?
Pooya
  • 4,385
  • 6
  • 45
  • 73
1
vote
2 answers

java.lang.NoSuchMethodError in Scalatra using Scalate with Markdown

So I have a Scalatra app (using Scalatra 2.2.1). I'm building views using Scalate; I've decided to go with the Jade/Markdown one-two. Only one problem: if I try to use markdown in a jade template (started with the :markdown tag), I get…
Gastove
  • 896
  • 2
  • 10
  • 21
1
vote
2 answers

Value not set error in Scalate/Jade

I am new to Jade and Scalate. I have the following route defined: get("/") { jade("index", "pageTitle" -> "Welcome to Jade", "welcomeMessage" -> "Hello my pretties") } And the template: -@ val pageTitle: String -@ val welcomeMessage:…
Synesso
  • 37,610
  • 35
  • 136
  • 207