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
17
votes
5 answers

Mustache Scalate vs Mustache Java

I need to pick a Mustache rendering engine for a Scala project of mine. Seems like the only two choices are Mustache-Java and Scalate? Are there any comparisons? Which one is the more stable/performant of the two?
Nej Kutcharian
  • 4,054
  • 5
  • 21
  • 27
10
votes
8 answers

Are there any Scala template engines other than scalate?

I'm tring to embed scalate in my website with sbt+jrebel, but found there are some problems I can't resolve. So I want to know if there any other template engines based on scala?
Freewind
  • 193,756
  • 157
  • 432
  • 708
8
votes
2 answers

Getting the scala compiler to work inside an OSGi runtime

I am using a Scala template engine (Scalate) to compile templates at runtime within an OSGi environment (Scala 2.9.1). The templates cannot be pre-compiled because they are built dynamically. In order for this to work, the Scala compiler needs to…
Raman
  • 17,606
  • 5
  • 95
  • 112
6
votes
1 answer

Scaml syntax highlighting on Emacs

How can I get Scaml (Scalate) syntax highlighting on Emacs? Already using Scala-mode.
alp247
  • 208
  • 2
  • 7
5
votes
1 answer

mustache how to get element in array by index

how to get element value by array in mustache object Map(name -> zzzzzzzzzzzzzzz, pageUrl -> /novokuzneck/zum-zum-dvernye-i-okonnye-resheniya/contacts, organiztionUrl -> http://192.168.0.106/c/1245678/, phones -> List( Map(phone ->…
litehause
  • 303
  • 5
  • 12
5
votes
1 answer

How to render a scalate template manually?

I want to try Scalate in this way: Provide a scalate template, say: index.html Use scala code to render it with some data manually Any template format is OK(mustache, Scaml, SSP, Jade) But I sad found nothing to do this even if I have read all the…
Freewind
  • 193,756
  • 157
  • 432
  • 708
5
votes
3 answers

Rendering Underscore variables in Jade

I have included the assets described in this ticket, and the Underscore variables work except when inside tags. I can not get variables to render inside dynamic tags data-id=someidfor doing things onClick with Backbone events. In standard…
user375566
4
votes
1 answer

Scalate ResourceNotFoundException in Scalatra

I'm trying the following based on scalatra-sbt.g8: class FooWeb extends ScalatraServlet with ScalateSupport { beforeAll { contentType = "text/html" } get("/") { templateEngine.layout("/WEB-INF/scalate/templates/hello-scalate.jade") …
Yang
  • 16,037
  • 15
  • 100
  • 142
4
votes
1 answer

How to use layout via ".scaml" in play+play-scalate

I'm using Play frameword and play-scalate plugin. The default demo of play-scalate provided is only ".ssp", but what I want to use is ".scaml". I create a "default.scaml", but I don't know how to include the inner views. Maybe my description is not…
Freewind
  • 193,756
  • 157
  • 432
  • 708
4
votes
2 answers

Jade interpolation within javascript

(Note, this is the Scalate Jade, if that makes a difference) I have the following route: get("/fruit") { contentType = "text/html" jade("fruity", "fruit" -> "apple") } And this fruity.jade template: -@ val fruit: String p Alerting…
Synesso
  • 37,610
  • 35
  • 136
  • 207
4
votes
0 answers

Dynamically include variables in Scalate template

I am using Scalate (scaml specifically, but the format is somewhat unimportant), and I have a number of values that are defined across a number of templates. These variables are not always known at compile time. My objective is to define them in a…
rs_atl
  • 8,935
  • 1
  • 23
  • 28
3
votes
0 answers

Scalate templates in Scalatra with WAR deployed in Jetty throw ResourceNotFoundException

When attempting to send email using scalate templates, resource not found exceptions are thrown (see below). Initially I thought it was a path issue, as in dev environment on sbt it works file, but deploying the WAR to jetty causes these…
Kareem
  • 844
  • 2
  • 8
  • 15
3
votes
0 answers

Scalate console and unfiltered?

I found scalate-console on the Scalate website. I think it would help significantly with debugging. Is there a way to use scalate-console with unfiltered? The site says that it uses "WAR overlay" to integrate the feature. Should it also work…
schmmd
  • 18,650
  • 16
  • 58
  • 102
3
votes
1 answer

Servlet link relative to application base

I am writing a servlet (specifically with Scalatra). In the servlet I have many links on a table of contents which is included with every page. I want these links to be relative to the application base. If I use links such as "/foo", everything…
schmmd
  • 18,650
  • 16
  • 58
  • 102
3
votes
1 answer

scala, spring, and scalate

I have a web project written in scala, spring, sitemesh, and jspx/jstl. The problem is with the jspx. I keep running into issues where it wants the types to be java collection types and so I have to keep converting between scala/java collections.…
Kevin
  • 24,871
  • 19
  • 102
  • 158
1
2 3 4 5