Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.25 KB

README.md

File metadata and controls

45 lines (33 loc) · 1.25 KB

Scaml

Build Status

Gitter

An inner DSL in Scala to write documents.

How to use?

With the import of org.scaml._ a new syntax is available:

import org.scaml._              // Basic syntax
import org.scaml.WebTemplate._  // Allows HTML constructs

object Main extends App {
  val page = ml"""
    $title Headline
    $p {
      To expand the effect of an modifiers like p over mutliple words use currly braces.
    }
  """

  val html = HTML(page)         // converts the page into HTML (using scala.xml)
  println(html)                 // prints the generated page to stdout
}

A running Play application could be found here: https://github.com/Jentsch/scaml-play-example

Dependencies

Add following lines to your build.sbt

libraryDependencies += "org.scaml" %% "scaml" % "0.3.0.19"
resolvers += "ScaML Bintray Repo" at "https://bintray.com/artifact/download/jentsch/maven/"

API

The API is hosted at https://jentsch.github.io/scaml/api