module StylishCabal
(
pretty
, prettyOpts
, RenderOptions(..)
, render
, parsePackageDescription
, readPackageDescription
, Result(..)
, PError(..)
, PWarning(..)
, result
, printWarnings
, displayError
, Default(..)
, GenericPackageDescription
, Doc
, plain
, displayIO
, displayS
)
where
import Data.Default
import Data.Monoid.Compat
import Distribution.PackageDescription
( GenericPackageDescription )
import Distribution.Parsec.Common
import Prelude.Compat
import Text.PrettyPrint.ANSI.Leijen
hiding ( (<>)
, pretty
)
import Parse
import Render
import Render.Options
import Transform
pretty :: GenericPackageDescription -> Doc
pretty = prettyOpts def
prettyOpts :: RenderOptions -> GenericPackageDescription -> Doc
prettyOpts opts gpd =
runReader (uncurry blockBodyToDoc $ toBlocks gpd) opts <> line
render :: Int -> Doc -> SimpleDoc
render = renderSmart 1.0