The escape-artist package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

A library for text decoration with ANSI escape sequences made easy. Decorate your terminal text expressively. Any complex data type, existing or custom, can be simply colorized by implementing the class ToEscapable, then output to terminal or converted to String using the provided functions.

Simple Example

import Data.Monoid ((<>))
import Text.EscapeArtist

underlines = Underline $ FgCyan "I am underlined" <> UnderlineOff " but I am not " <> FgMagenta "and I am over here"

putEscLn underlines

Implementing ToEscapable

import Data.Monoid ((<>))
import Text.EscapeArtist

data ABC = A | B deriving (Show, Eq)

instance ToEscapable ABC where
    toEscapable (A) = FgRed $ show A
    toEscapable (B) = FgGreen $ show B

instance (ToEscapable a) => ToEscapable (Maybe a) where
     toEscapable (Just a) = FgGreen "Just" <> Inherit " " <> FgYellow a
     toEscapable a = FgRed $ show a

NOTE: For GHC < 7.10 you will also need to explicitly derive Typeable for custom data types implementing ToEscapable. See the section Explicitly Derived Typeable in the documentation.

Comprehensive Documentation

See comprehensive documentation with many examples here:

https://github.com/EarthCitizen/escape-artist#readme

Properties

Versions1.0.0, 1.1.0, 1.1.0
Change logNone available
Dependenciesbase (>=4.7.0.2 && <5), bytestring (>=0.10.4.0 && <0.11), text (>=1.2.0.4 && <1.3) [details]
LicenseBSD3
Copyright2016 Ryan Daniels
AuthorRyan Daniels
Maintainerrd.github@gmail.com
CategoryText
Home pagehttps://github.com/EarthCitizen/escape-artist#readme
Source repositoryhead: git clone https://github.com/EarthCitizen/escape-artist
UploadedTue Jan 24 10:03:43 UTC 2017 by ryan_daniels

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees