packages feed

prettyprinter-ansi-terminal 0.1 → 1

raw patch · 5 files changed

+35/−10 lines, 5 filesdep ~basedep ~prettyprinter

Dependency ranges changed: base, prettyprinter

Files

+ CONTRIBUTORS.md view
@@ -0,0 +1,24 @@+# Contributors++A list of people that have contributed to this library, be it code, ideas, or+even just as rubber ducks. :-)++Ordered by earliest appearance in the git log.++## `prettyprinter` library (this one)++- Moritz Kiefer, @cocreature+- Daniel Mendler, @minad – several ideas after the preliminary release+- David Luposchainsky, @quchen – current maintainer++## `ansi-wl-pprint` (origin forked from)++- Edward Kmett, @edwardk – maintainer of `ansi-wl-pprint`+- Herbert Valerio Riedel, @hvr+- Bradford Larsen+- Sebastian Witte+- Andrew Shulaev+- David Fox+- Max Bolingbroke+- Samir Jindel+- Bryan O'Sullivan, @bos
README.md view
@@ -1,9 +1,9 @@ ANSI terminal prettyprinter renderer ==================================== -This package defines a renderer for documents generated by the `wl-pprint`+This package defines a renderer for documents generated by the `prettyprinter` package, suitable for displaying them on ANSI-compatible terminals, including colors, boldening, underlining and italication.  For more information about the prettyprinter in general, refer to the main-`wl-pprint` package documentation.+`prettyprinter` package documentation.
misc/version-compatibility-macros.h view
@@ -12,8 +12,8 @@ #define FOLDABLE_TRAVERSABLE_IN_PRELUDE MIN_VERSION_base(4,8,0) #define MONOID_IN_PRELUDE               MIN_VERSION_base(4,8,0) #define NATURAL_IN_BASE                 MIN_VERSION_base(4,8,0)-#define SEMIGROUP_IN_BASE               MIN_VERSION_base(4,8,0) +#define SEMIGROUP_IN_BASE               MIN_VERSION_base(4,9,0) #define MONAD_FAIL                      MIN_VERSION_base(4,9,0)  #endif
prettyprinter-ansi-terminal.cabal view
@@ -1,5 +1,5 @@ name:                prettyprinter-ansi-terminal-version:             0.1+version:             1 cabal-version:       >= 1.10 category:            User Interfaces, Text synopsis:            ANSI terminal backend for the modern, extensible and well-documented prettyprinter.@@ -8,6 +8,7 @@ license-file:        LICENSE.md extra-source-files:  README.md                    , misc/version-compatibility-macros.h+                   , CONTRIBUTORS.md author:              David Luposchainsky maintainer:          David Luposchainsky <dluposchainsky at google> bug-reports:         http://github.com/quchen/prettyprinter/issues@@ -35,7 +36,7 @@           base < 127         , ansi-terminal >= 0.4.0 && < 0.7         , text-        , prettyprinter >= 0 && < 0.2+        , prettyprinter < 1.1      if impl(ghc >= 8.0)         ghc-options: -Wcompat
src/Data/Text/Prettyprint/Doc/Render/Terminal.hs view
@@ -4,7 +4,7 @@  #include "version-compatibility-macros.h" --- | Render 'SimpleDoc' in a terminal.+-- | Render 'SimpleDocStream' in a terminal. module Data.Text.Prettyprint.Doc.Render.Terminal (     -- * Styling     AnsiTerminal, Color(..),@@ -133,7 +133,7 @@ --     red\e[0m -- -- Run the above via @echo -e '...'@ in your terminal to see the coloring.-renderLazy :: SimpleDoc AnsiTerminal -> TL.Text+renderLazy :: SimpleDocStream AnsiTerminal -> TL.Text renderLazy doc   = let (resultBuilder, remainingStyles) = execStackMachine [emptyStyle] (build doc)     in case remainingStyles of@@ -144,7 +144,7 @@                      "end of rendering (there should be only 1). Please report" ++                      " this as a bug.") -build :: SimpleDoc AnsiTerminal -> StackMachine TLB.Builder CombinedStyle ()+build :: SimpleDocStream AnsiTerminal -> StackMachine TLB.Builder CombinedStyle () build = \case     SFail -> panicUncaughtFail     SEmpty -> pure ()@@ -221,7 +221,7 @@  -- | @('renderStrict' sdoc)@ takes the output @sdoc@ from a rendering and -- transforms it to strict text.-renderStrict :: SimpleDoc AnsiTerminal -> Text+renderStrict :: SimpleDocStream AnsiTerminal -> Text renderStrict = TL.toStrict . renderLazy  @@ -231,7 +231,7 @@ -- >>> renderIO System.IO.stdout (layoutPretty defaultLayoutOptions "hello\nworld") -- hello -- world-renderIO :: Handle -> SimpleDoc AnsiTerminal -> IO ()+renderIO :: Handle -> SimpleDocStream AnsiTerminal -> IO () renderIO h sdoc = TL.hPutStrLn h (renderLazy sdoc)  -- | @('putDoc' doc)@ prettyprints document @doc@ to standard output, with a page