Skip to content

Commit

Permalink
improve Command.toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
edadma committed Jul 4, 2018
1 parent f2ecc28 commit e9eedcb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Backslash
[![Build status](https://ci.appveyor.com/api/projects/status/h5b23n2vd0k4oh9q/branch/master?svg=true)](https://ci.appveyor.com/project/edadma/backslash/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/edadma/backslash/badge.svg?branch=master)](https://coveralls.io/github/edadma/backslash?branch=master)
[![License](https://img.shields.io/badge/license-ISC-blue.svg)](https://github.com/edadma/backslash/blob/master/LICENSE)
[![Version](https://img.shields.io/badge/latest_release-v0.4.16-orange.svg)](https://github.com/edadma/backslash/releases/tag/v0.4.16)
[![Version](https://img.shields.io/badge/latest_release-v0.4.17-orange.svg)](https://github.com/edadma/backslash/releases/tag/v0.4.17)

*Backslash* is a string templating language written in [Scala](http://scala-lang.org). Backslash looks like [TeX](https://en.wikipedia.org/wiki/TeX) with the default delimiters (which can be changed), but it's not TeX. Backslash behaves like any other macro/templating language: it copies input text to output. Backslash is an attempt to create a dryer templating language that still allows you to copy HTML (or whatever you're using it for) verbatim. So, although Backslash is somewhat inspired by TeX, it shares very little in common with it except less typing. If your HTML doesn't containing any scripting then the "TeXish" delimiters (`\`, `{`, `}`) are usually fine. However, as in [Mustache](http://mustache.github.io/), delimiters can be changed anywhere in the input stream (except between command arguments).

Expand Down Expand Up @@ -157,7 +157,7 @@ This program prints
This next example shows how to use *Backslash* as an executable from the command line.

```bash
echo "testing \join \v \", \"" | java -jar backslash-0.4.16.jar -j "{v: [\"one\", \"two\", \"three\"]}" --
echo "testing \join \v \", \"" | java -jar backslash-0.4.17.jar -j "{v: [\"one\", \"two\", \"three\"]}" --
```

The above command prints
Expand All @@ -181,7 +181,7 @@ Use the following definition to use Backslash in your Maven project:
<dependency>
<groupId>xyz.hyperreal</groupId>
<artifactId>backslash</artifactId>
<version>0.4.16</version>
<version>0.4.17</version>
</dependency>
```

Expand All @@ -190,14 +190,14 @@ Add the following to your `build.sbt` file to use Backslash in your SBT project:
```sbt
resolvers += "Hyperreal Repository" at "https://dl.bintray.com/edadma/maven"

libraryDependencies += "xyz.hyperreal" %% "backslash" % "0.4.16"
libraryDependencies += "xyz.hyperreal" %% "backslash" % "0.4.17"
```

### Executable

An executable can be downloaded from [here](https://dl.bintray.com/edadma/generic/backslash-0.4.16.jar). *You do not need* the Scala library for it to work because the JAR already contains all dependencies. You just need Java 8+ installed.
An executable can be downloaded from [here](https://dl.bintray.com/edadma/generic/backslash-0.4.17.jar). *You do not need* the Scala library for it to work because the JAR already contains all dependencies. You just need Java 8+ installed.

Run it as a normal Java executable JAR with the command `java -jar backslash-0.4.16.jar <template>` in the folder where you downloaded the file, where *template* is the name of the template file to be rendered.
Run it as a normal Java executable JAR with the command `java -jar backslash-0.4.17.jar <template>` in the folder where you downloaded the file, where *template* is the name of the template file to be rendered.

Building
--------
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "backslash"

version := "0.4.16"
version := "0.4.17"

scalaVersion := "2.12.6"

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/Command.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import xyz.hyperreal.hsl.HSL


abstract class Command( val name: String, val arity: Int, val eval: Boolean = true ) extends ((Position, Renderer, List[Any], Map[String, Any], AnyRef) => Any) {
override def toString = s"<$name/$arity>"
override def toString = s"""xyz.hyperreal.backslash.Command.standard("$name")"""
}

object Command {
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ object Main extends App {

def usage {
"""
|Backslash v0.4.16
|Backslash v0.4.17
|
|Usage: java -jar backslash-0.4.16.jar <options> <template>
|Usage: java -jar backslash-0.4.17.jar <options> <template>
|
|Options: --help display this help and exit
| -s <name> <string> assign <string> to variable <name>
Expand Down

0 comments on commit e9eedcb

Please sign in to comment.