Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (57 sloc) 2.03 KB


A tiny jQuery-like HTML templating library written in Scala.

On templating, and a shameless plug of Moulder

Moulder in action


You'll need SBT 0.10 (or newer):

$ git clone git://
$ cd moulder-s
$ sbt package publish-local

You can then use this library in your projects by grabbing the generated jar (in the target directory) and its dependencies.


Please consider using Github issues tracker to submit bug reports or feature requests.

Using this library

Here's a quick sample of how moulder-s can be used to manipulate html:

Given this markup:


This moulder based snippet:

val document = Jsoup.parse("<html><body><h1>[...]</h1></body></html>")
val s = MoulderShop()
    :: attr("class", SeqValue("even" :: "odd" :: Nil).cycle)
    :: text(SeqValue(items))
    :: append(html(transform(SeqValue(items), (c: String) => "<p>" + c + "</p>")))
    :: Nil)

Will generate the following:

        <h1 class="even">Spring</h1> 
        <h1 class="odd">Summer</h1> 
        <h1 class="even">Autumn</h1> 
        <h1 class="odd">Winter</h1> 

Or in plain english:

  • For each item in the list of seasons, repeat the h1 element
  • For each generated h1 element, set its class to even or odd
  • Also set it's text content to the corresponding season
  • And finally, append a paragraph after it with the season name as its content


See LICENSE for details.