haskell-docs-4.1.5: A program to find and display the docs and type of a name

Safe HaskellNone

Haskell.Docs.Formatting

Contents

Description

Formatting of Haddock documentation.

Synopsis

Formatting

printSexp :: [IdentDoc] -> Ghc ()Source

Print docs as s-expressions.

printIdentDocSource

Arguments

:: Bool

Print modules only?

-> Bool

Print package?

-> Bool

Print module?

-> IdentDoc 
-> Ghc () 

Print an identifier' documentation.

formatDoc :: Doc String -> StringSource

Format some documentation to plain text.

Internal functions

data Sexp Source

S-expression type.

Constructors

Atom String 
String String 
List [Sexp] 

renderSexp :: Sexp -> StringSource

Render an s-expression to string.

toSexp :: IdentDoc -> Ghc SexpSource

Convert docs to an s-expression.

doc :: Doc String -> StringSource

Render the doc.

normalize :: [Char] -> [Char]Source

Strip redundant whitespace.

trim :: [Char] -> [Char]Source

Trim either side of a string.

formatExample :: Example -> StringSource

Format an example to plain text.

formatArg :: Show a => a -> Doc String -> StringSource

Format an argument.

indentAfter :: Int -> String -> StringSource

Indent after the first line.