unindent


License

License

GroupId

GroupId

com.davegurnell
ArtifactId

ArtifactId

unindent_2.11
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

unindent
unindent
Project URL

Project URL

https://github.com/davegurnell/unindent
Project Organization

Project Organization

com.davegurnell
Source Code Management

Source Code Management

https://github.com/davegurnell/unindent.git

Download unindent_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.davegurnell/unindent_2.11/ -->
<dependency>
    <groupId>com.davegurnell</groupId>
    <artifactId>unindent_2.11</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.davegurnell/unindent_2.11/
implementation 'com.davegurnell:unindent_2.11:1.1.1'
// https://jarcasting.com/artifacts/com.davegurnell/unindent_2.11/
implementation ("com.davegurnell:unindent_2.11:1.1.1")
'com.davegurnell:unindent_2.11:jar:1.1.1'
<dependency org="com.davegurnell" name="unindent_2.11" rev="1.1.1">
  <artifact name="unindent_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.davegurnell', module='unindent_2.11', version='1.1.1')
)
libraryDependencies += "com.davegurnell" % "unindent_2.11" % "1.1.1"
[com.davegurnell/unindent_2.11 "1.1.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
org.scala-lang : scala-reflect jar 2.11.12

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar 3.0.8

Project Modules

There are no modules declared in this project.

Unindent

Indent-adjusted multiline string literals for Scala.

Copyright 2015 Dave Gurnell. Licensed Apache 2.

Build Status Coverage status Maven Central

Getting Started

Add the following to your build.sbt:

libraryDependencies += "com.davegurnell" %% "unindent" % "<<VERSION>>"

Synopsis

Unindent's i"..." string interpolator is like Scala's s"..." interpolator, except it removes the indent applied in the source file. The behaviour is very similar to Coffeescript's multiline string literals.

import unindent._

val example =
  i"""
  This is an indented multi-line string.
  This line ends up unindented.
    This line ends up indented by two spaces.
  It supports interpolation too: ${1 + 1}.
  """

println("[" + example + "]")
// [This is an indented multi-line string.
// This line ends up unindented.
//   This line ends up indented by two spaces.
// It supports interpolation too: 2.]

See the tests for more examples.

Versions

Version
1.1.1
1.1.0
1.0.0