Name: sbt-pamflet
Owner: sbt
Description: sbt plugin to run Pamflet (and Pamflet plugin to run sbt)
Created: 2015-02-02 05:28:44.0
Updated: 2017-04-16 14:48:50.0
Pushed: 2017-01-15 22:41:49.0
Size: 26
Language: Scala
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is an sbt plugin that integrates Pamflet to the build.
In addition, it provides console
and compile
fence plugins to your pamflet.
From sbt shell:
This works like normal Pamflet preview mode. To write your pamflet run:
Write
PamfletCompilePlugin
introduces compile
fence plugin.
Substitute normal scala
fence code block with compile
:
```compile
class nonsense }
```
By default, this fence plugin will fail illegal Scala code:
or] :1: Unmatched closing brace '}' ignored here
or] class nonsense }
or] ^
or] one error found
To use third-party library include it into Pamflet
configuration in build.sbt
:
val dispatchV = "0.11.2"
val dispatch = "net.databinder.dispatch" %% "dispatch-core" % dispatchV
root = (project in file(".")).
ttings(
libraryDependencies += dispatch % Pamflet
(currently supports Scala 2.10.4 and 2.11.5 only)
PamfletConsolePlugin
introduces console
fence plugin.
Write out REPL promps in your pamflet, it will automatically exapand to an interaction:
```console
scala> :paste
class Foo
object Foo
scala> Foo
```
This exapands out as follows:
a> :paste
ntering paste mode (ctrl-D to finish)
s Foo
ct Foo
xiting paste mode, now interpreting.
ned class Foo
ned module Foo
a> Foo
: Foo.type = Foo$@7b020812