haskell-docs-4.1.3: A program to find and display the docs of a name from a given module.

Safe HaskellNone
LanguageHaskell98

Haskell.Docs.Formatting

Contents

Description

Formatting of Haddock documentation.

Synopsis

Formatting

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

Print docs as s-expressions.

printIdentDoc Source

Arguments

:: Bool

Print modules only?

-> Bool

Print package?

-> Bool

Print module?

-> IdentDoc 
-> Ghc () 

Print an identifier' documentation.

formatDoc :: Doc String -> String Source

Format some documentation to plain text.

Internal functions

data Sexp Source

S-expression type.

Constructors

Atom String 
String String 
List [Sexp] 

renderSexp :: Sexp -> String Source

Render an s-expression to string.

toSexp :: IdentDoc -> Ghc Sexp Source

Convert docs to an s-expression.

doc :: Doc String -> String Source

Render the doc.

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

Strip redundant whitespace.

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

Trim either side of a string.

formatExample :: Example -> String Source

Format an example to plain text.

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

Format an argument.

indentAfter :: Int -> String -> String Source

Indent after the first line.