Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Renders nested tree branches in unicode and ascii
Scala
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
notes
project
src
.gitignore
LICENSE
README.md
build.sbt

README.md

treeline

A unicode tree renderer.

├─┬ ↑
│ └── ⬆
├─┬ ⬆
│ └── ↑
└── ↑

install

using ls

ls-install treeline

using sbt

libraryDepdendencies += "me.lessis" %% "treeline" % "0.1.0"

usage

Treeline exposes two objects Trees and Branches. A Tree is made of one or more Branches and a Branch is just a name to display and an optional list of Branches.

import treeline._
println(Tree()(Branch("foo", Branch("bar", Branch("baz")), Branch("boom"))))
foo
├─┬ bar
│ └── baz
└── boom

You can also render in ascii where unicode is not supported by calling the ascii method on a tree.

println(Tree().ascii(Branch("foo", Branch("bar", Branch("baz")), Branch("boom"))))

This will render

foo
+-- bar
| `-- baz
`-- boom

Doug Tangren (softprops) 2013

Something went wrong with that request. Please try again.