Skip to content

Skeleton for creating your new Scala project based on Sinetja

Notifications You must be signed in to change notification settings

sinetja/sinetja-scaleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skeleton for creating your new Scala project based on Sinetja.

See also:

Run in development mode

sbt/sbt run

Create project

To create Eclipse project:

sbt/sbt eclipse

To create IntelliJ project:

sbt/sbt gen-idea

You then can run the project inside Eclipse or IntelliJ.

Template engine

For your convenience, this skeleton includes (see build.sbt) the superfast Scalatags template engine. You can use others if you want.

Scala XML

If you want to use Scala XML syntax, add to build.sbt:

libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.2"

Because XML is a little different than XHTML (e.g. closing tag), if you want to render HTML, you need to do like this:

import scala.xml.Xhtml

res.respondHtml(Xhtml.toXhtml(
  <body>
    <p>Hi World</p>
  </body>
))

If you just return the XML as is, without the Xhtml.toXhtml converter, the result may not be rendered correctly as you want.

Distribute

To package for distribution:

sbt/sbt xitrum-package

Directory target/xitrum will be created.

To run:

cd target/xitrum
script/start

It will run main method in class skeleton.App. Please modify the start script if you want to run other.

About

Skeleton for creating your new Scala project based on Sinetja

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published