Permalink
Browse files

Update README.md

  • Loading branch information...
1 parent a7391e5 commit 0f5a5ab7e5ab4bd2c0b927f23a7913f026cc7177 @mandubian committed Feb 20, 2012
Showing with 33 additions and 3 deletions.
  1. +33 −3 README.md
View
@@ -1,7 +1,9 @@
-# Play2 Rich Json Tool
+`# Play2 Rich Json Tool
> Some sugar syntax to write your Play2/Scala JSON in a more compact way
+ val richJson = "this" : ( "is" \: ( "my" @@ ( "times" \: 1 ) @@ "play2" @@ "tool" ) )
+
## Example
Take the following JSON:
@@ -89,7 +91,35 @@ Isn't it more compact ?
## Doc
-### Import the implicits conversion in your local context
+### Build RichJson Jar (till this is in an online repo)
+
+#### Git clone the project
+
+ git clone git://github.com/mandubian/play2-scala-richjson.git
+
+
+#### Build RichJson
+
+ > sbt compile publish-local
+ It should publish into your local Ivy repository. For ex: "/Users/USERNAME/.ivy2/local" on a Mac
+
+
+#### Add RichJson dependency to your `$YOUR_PLAY_APP/project/Build.scala`
+
+ val appDependencies = Seq(
+ // Add your project dependencies here,
+ "play.tools.richjson" %% "play-2.0-scala-richjson-tool" % "0.1-SNAPSHOT"
+ )
+
+ // need to update to your own repo (put the right directory)
+ val moduleRepo = Resolver.file("local repository", file("/Users/USERNAME/.ivy2/local"))(Resolver.ivyStylePatterns)
+
+ val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
+ resolvers += moduleRepo,
+ resolvers += ("typesafe snapshots" at "http://repo.typesafe.com/typesafe/snapshots/")
+ )
+
+### Import the implicits conversion in your local context (for ex, an action in a controller)
// classic JSON imports
import play.api.libs.json._
@@ -107,7 +137,7 @@ Here are the correspondences between Json & RichJson syntax :
RichJson returns a classic Play2/Scala _JsObject_
-val richJson:JsObject = "key" \: "value"
+ val richJson:JsObject = "key" \: "value"
Have Fun

0 comments on commit 0f5a5ab

Please sign in to comment.