Skip to content

Commit 9b55b56

Browse files
authored
Update README.md
1 parent 1a50717 commit 9b55b56

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,35 @@
88

99
An insanely simple type driven approach to string interpolation, aiming at consistent, secure, and only-human-readable logs and console outputs, and for safe string operations !
1010

11-
Checkout the project [website](https://afsalthaj.github.io/safe-string-interpolation/) for all information.
11+
```scala
12+
@ import $ivy.`io.github.afsalthaj::safe-string-interpolation:2.1.1`
13+
import $ivy.$
14+
15+
@ import com.thaj.safe.string.interpolator._
16+
import com.thaj.safe.string.interpolator._
17+
18+
@ case class Port(int: Int) extends AnyVal
19+
defined class Port
20+
21+
@ val port = Port(1)
22+
port: Port = Port(1)
23+
24+
@ ss"Db details: Port is ${port}"
25+
cmd7.sc:1: could not find implicit value for parameter ev: com.thaj.safe.string.interpolator.Safe[ammonite.$sess.cmd5.Port]
26+
val res7 = ss"Db details: Port is ${port}"
27+
^
28+
Compilation Failed
29+
30+
@ ss"Db details: Port is ${port.int}"
31+
res7: SafeString = SafeString("Db details: Port is 1")
32+
33+
@ import instances._
34+
import instances._
35+
36+
@ ss"Db details: Port is ${port}"
37+
res9: SafeString = SafeString("Db details: Port is { int : 1 }")
38+
39+
@
40+
41+
```
42+
Checkout the project [website](https://afsalthaj.github.io/safe-string-interpolation/) for more features and possibilities.

0 commit comments

Comments
 (0)