ContentsIndex
Darcs.ColorPrinter
Synopsis
cr :: Doc
dollar :: Doc
errorDoc :: Doc -> a
traceDoc :: Doc -> a -> a
assertDoc :: Maybe Doc -> a -> a
data Policy = Policy {
poColor :: Bool
poEscape :: Bool
poLineColor :: Bool
poAltColor :: Bool
poIsprint :: Bool
po8bit :: Bool
poNoEscX :: String
poEscX :: String
poTrailing :: Bool
poCR :: Bool
poSpace :: Bool
}
getPolicy :: Handle -> Policy
fancyPrinters :: Printers
lineColorTrans :: Policy -> Color -> Doc -> Doc
lineColorSuffix :: Policy -> [Printable] -> [Printable]
colorPrinter :: Policy -> Color -> Printer
userchunkPrinter :: Policy -> Printer
escapePrinter :: Policy -> Printer
escape :: Policy -> String -> Doc
no_escape :: Policy -> Char -> Bool
isPrintableAscii :: Char -> Bool
quoteChar :: Char -> String
mark_escape :: Policy -> Doc -> Doc
color :: Policy -> Color -> Doc -> Doc
make_color' :: Color -> Doc -> Doc
make_color :: Color -> Doc -> Doc
set_color :: Color -> String
make_asciiart :: Doc -> Doc
reset_color :: String
with_color :: String -> Doc -> Doc
make_bold :: Doc -> Doc
make_invert :: Doc -> Doc
Documentation
cr :: Doc
dollar :: Doc
errorDoc :: Doc -> a
traceDoc :: Doc -> a -> a
assertDoc :: Maybe Doc -> a -> a
data Policy
the Policy type is a record containing the variables which control how Docs will be rendered on some output.
Constructors
Policy
poColor :: Booloverall use of color
poEscape :: Booloverall use of escaping
poLineColor :: Booloverall use of colored lines (only hunks for now)
poAltColor :: Boolalternative to color (bold, inverse)
poIsprint :: Booldon't escape isprints
po8bit :: Booldon't escape 8-bit chars
poNoEscX :: Stringextra chars to never escape
poEscX :: Stringextra chars to always escape
poTrailing :: Boolescape trailing spaces
poCR :: Boolignore r at end of lines
poSpace :: Boolescape spaces (used with poTrailing)
getPolicy :: Handle -> Policy
getPolicy returns a suitable policy for a given handle. The policy is chosen according to environment variables, and to the type of terminal which the handle represents
fancyPrinters :: Printers
fancyPrinters h returns a set of printers suitable for outputting to h
lineColorTrans :: Policy -> Color -> Doc -> Doc
lineColorTrans policy tries to color a Doc, according to policy po. That is, if policy has poLineColor set, then colors the line, otherwise does nothing.
lineColorSuffix :: Policy -> [Printable] -> [Printable]
colorPrinter :: Policy -> Color -> Printer
userchunkPrinter :: Policy -> Printer
escapePrinter :: Policy -> Printer
escape :: Policy -> String -> Doc
escape policy string escapes string according to the rules defined in policy, turning it into a Doc.
no_escape :: Policy -> Char -> Bool
no_escape policy c tells wether c will be left as-is when escaping according to policy
isPrintableAscii :: Char -> Bool
isPrintableAscii tells wether a character is a printable character of the ascii range.
quoteChar :: Char -> String
quoteChar represents a special character as a string. * quoteChar '^c' (where ^c is a control character) is ^c * Otherwise, quoteChar returns hex, where hex is the hexadecimal number of the character.
mark_escape :: Policy -> Doc -> Doc
mark_escape policy doc marks doc with the appropriate marking for escaped characters according to policy
color :: Policy -> Color -> Doc -> Doc
color policy color doc colors doc with color color if policy is not set to use an alternative to color. In that case, it makes the text bold instead.
make_color' :: Color -> Doc -> Doc
make_color :: Color -> Doc -> Doc
set_color :: Color -> String
make_asciiart :: Doc -> Doc
make_asciiart doc tries to make doc (usually a single escaped char) stand out with the help of only plain ascii, i.e., no color or font style.
reset_color :: String
the string to reset the terminal's color.
with_color :: String -> Doc -> Doc
with_color color doc returns a colorized version of doc. color is a string that represents a color, given by set_color
make_bold :: Doc -> Doc
make_bold boldens a doc.
make_invert :: Doc -> Doc
make_invert returns an invert video version of a doc.
Produced by Haddock version 2.4.2