#if (lineItems.find(_.price > 10).isDefined)
<b>Welcome big spender!</b>
#end
<%
val people = Map("James" -> "Mells", "Hiram" -> "Tampa")
%>
<h1>Table Example</h1>
<div class="main">
<table>
<tr>
<th>Name</th>
<th>Location</th>
</tr>
#for ((name, location) <- people)
<tr>
<td>${name}</td>
<td>${location}</td>
</tr>
#end
</table>
</div>
<div class="description">
<p>
This is lots and lots of text.
<b>Scalate</b> really is rather awesome!
</p>
</div>
- val people = Map("James" -> "Mells", "Hiram" -> "Tampa")
%h1 Table Example
.main
%table
%tr
%th Name
%th Location
- for ((name, location) <- people)
%tr
%td = name
%td = location
.description
%p
This is lots and lots of text.
<b>Scalate</b> really is rather awesome!
- val people = Map("James" -> "Mells", "Hiram" -> "Tampa")
h1 Table Example
.main
table
tr
th Name
th Location
- for ((name, location) <- people)
tr
td= name
td= location
.description
:markdown
This is lots and lots of text.
**Scalate** really is rather awesome!
<table>
<tr>
<th>Name</th>
<th>Location</th>
</tr>
{{#people}}
<tr>
<td>{{name}}</td>
<td>{{location}}</td>
</tr>
{{/people}}
</table>
<p>
This is lots and lots of text.
<b>Scalate</b> really is rather awesome!
</p>
<ul class="people">
<li>
<a href="#" class="person">A person</a>
</li>
<li>
<a href="#" class="person">Another person</a>
</li>
</ul>
import org.fusesource.scalate.scuery._
case class Person(name: String, location: String)
object MyTransform extends Transformer {
val people = List(Person("James", "Beckington"), Person("Hiram", "Tampa"))
$(".people").contents {
node =>
people.flatMap {
p =>
transform(node.$("li:first-child")) {
$ =>
$("a.person").contents = p.name
$("a.person").attribute("href").value = "http://acme.com/bookstore/" + p.name
}
}
}
}
<filter>
<filter-name>TemplateEngineFilter</filter-name>
<filter-class>org.fusesource.scalate.servlet.TemplateEngineFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TemplateEngineFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
package scalate
import org.fusesource.scalate.TemplateEngine
import java.io.File
class Boot(engine: TemplateEngine) {
def run: Unit = {
// lets change the workingDirectory
engine.workingDirectory = new File("myScalateWorkDir")
}
}
<build>
<plugins>
<plugin>
<groupId>org.fusesource.scalate</groupId>
<artifactId>maven-scalate-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<goals>
<goal>precompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
scalate create jersey mygroup myartifact
cd myartifact
mvn jetty:run
scalate
help
scalate create sitegen mygroup mysite
cd mysite
mvn jetty:run
cd samples/scalate-presentation
mvn jetty:run