sbt/sbt-pamflet

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

Homepage:

Size: 26

Language: Scala

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

sbt-pamflet

This is an sbt plugin that integrates Pamflet to the build. In addition, it provides console and compile fence plugins to your pamflet.

usage

From sbt shell:


This works like normal Pamflet preview mode. To write your pamflet run:

Write
compile fence plugin

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

console fence plugin

(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

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.