packages feed

escape-artist-1.2.0.0: escape-artist.cabal

name:                escape-artist
version:             1.2.0.0
synopsis:            ANSI Escape Sequence Text Decoration Made Easy
description:
    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
    @
    .
    <<https://raw.githubusercontent.com/EarthCitizen/escape-artist/master/images/underline_off.png>>
    .
    Implementing 'ToEscapable'
    .
    @
    import Data.Monoid ((\<\>))
    import Text.EscapeArtist
    .
    data ABC = A | B deriving (Show, Eq)
    .
    instance ToEscapable ABC where
    &#x20;   toEscapable (A) = FgRed $ show A
    &#x20;   toEscapable (B) = FgGreen $ show B
    .
    instance (ToEscapable a) => ToEscapable (Maybe a) where
    &#x20;    toEscapable (Just a) = FgGreen \"Just\" \<\> Inherit \" \" \<\> FgYellow a
    &#x20;    toEscapable a = FgRed $ show a
    @
    .
    Comprehensive Documentation
    .
    See comprehensive documentation with many examples here:
    .
    <https://github.com/EarthCitizen/escape-artist#readme>

homepage:            https://github.com/EarthCitizen/escape-artist#readme
license:             BSD3
license-file:        LICENSE
author:              Ryan Daniels
maintainer:          rd.github@gmail.com
copyright:           2016-2019 Ryan Daniels
category:            Text
build-type:          Simple
cabal-version:       >= 1.22
extra-source-files:
  CHANGELOG.md

library
  hs-source-dirs:      src
  exposed-modules:     Text.EscapeArtist
                     , Text.EscapeArtist.Internal
                     , Text.EscapeArtist.Internal.Constants
  default-extensions:  CPP, ExistentialQuantification, ExtendedDefaultRules, FlexibleInstances, NoMonomorphismRestriction
  build-depends:       base >= 4.8.0.0 && < 5
                     , bytestring >= 0.10.4.0 && < 0.11
                     , text >= 1.2.0.4 && < 1.3
  if impl(ghc < 7.10.0)
    build-depends: unsupported-ghc-version > 1 && < 1
  ghc-options:         -Wall -Wno-type-defaults
  default-language:    Haskell2010

test-suite escape-artist-spec-test
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  other-modules:       Text.EscapeArtistSpec
                     , Text.EscapeArtistSpec.TestData
  main-is:             Spec.hs
  build-depends:       base >= 4.8.0.0 && < 5
                     , bytestring >= 0.10.4.0 && < 0.11
                     , escape-artist
                     , hspec >= 2.2.4 && < 2.8
                     , silently >= 1.2.5 && < 1.3
                     , text >= 1.2.0.4 && < 1.3
                     , QuickCheck >= 2.9.2 && < 2.14
  if impl(ghc < 7.10.0)
    build-depends: unsupported-ghc-version > 1 && < 1
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  default-extensions:  CPP, ExistentialQuantification, ExtendedDefaultRules, FlexibleInstances, NoMonomorphismRestriction
  default-language:    Haskell2010

test-suite escape-artist-visual-test
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             VisualTest.hs
  if impl(ghc < 7.10.0)
    build-depends: unsupported-ghc-version > 1 && < 1
  build-depends:       base >= 4.8.0.0 && < 5
                     , bytestring >= 0.10.4.0 && < 0.11
                     , escape-artist
                     , text >= 1.2.0.4 && < 1.3
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  default-extensions:  CPP, ExtendedDefaultRules, NoMonomorphismRestriction
  default-language:    Haskell2010

source-repository head
  type:     git
  location: https://github.com/EarthCitizen/escape-artist