pandoc-1.8.1.1: Conversion between markup formatsSource codeContentsIndex
Text.Pandoc.Pretty
Portabilityportable
Stabilityalpha
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Description
A prettyprinting library for the production of text documents, including wrapped text, indentated blocks, and tables.
Synopsis
data Doc
render :: (Monoid a, IsString a) => Maybe Int -> Doc -> a
cr :: Doc
blankline :: Doc
space :: Doc
text :: String -> Doc
char :: Char -> Doc
prefixed :: String -> Doc -> Doc
flush :: Doc -> Doc
nest :: Int -> Doc -> Doc
hang :: Int -> Doc -> Doc -> Doc
nowrap :: Doc -> Doc
offset :: Doc -> Int
height :: Doc -> Int
lblock :: Int -> Doc -> Doc
cblock :: Int -> Doc -> Doc
rblock :: Int -> Doc -> Doc
(<>) :: Doc -> Doc -> Doc
(<+>) :: Doc -> Doc -> Doc
($$) :: Doc -> Doc -> Doc
($+$) :: Doc -> Doc -> Doc
isEmpty :: Doc -> Bool
empty :: Doc
cat :: [Doc] -> Doc
hcat :: [Doc] -> Doc
hsep :: [Doc] -> Doc
vcat :: [Doc] -> Doc
vsep :: [Doc] -> Doc
inside :: Doc -> Doc -> Doc -> Doc
braces :: Doc -> Doc
brackets :: Doc -> Doc
parens :: Doc -> Doc
quotes :: Doc -> Doc
doubleQuotes :: Doc -> Doc
Documentation
data Doc Source
show/hide Instances
render :: (Monoid a, IsString a) => Maybe Int -> Doc -> aSource
Renders a Doc. render (Just n) will use a line length of n to reflow text on breakable spaces. render Nothing will not reflow text.
cr :: DocSource
A carriage return. Does nothing if we're at the beginning of a line; otherwise inserts a newline.
blankline :: DocSource
Inserts a blank line unless one exists already. (blankline blankline has the same effect as blankline. If you want multiple blank lines, use text \n\n.
space :: DocSource
A breaking (reflowable) space.
text :: String -> DocSource
A literal string.
char :: Char -> DocSource
A character.
prefixed :: String -> Doc -> DocSource
Uses the specified string as a prefix for every line of the inside document (except the first, if not at the beginning of the line).
flush :: Doc -> DocSource
Makes a Doc flush against the left margin.
nest :: Int -> Doc -> DocSource
Indents a Doc by the specified number of spaces.
hang :: Int -> Doc -> Doc -> DocSource
A hanging indent. hang ind start doc prints start, then doc, leaving an indent of ind spaces on every line but the first.
nowrap :: Doc -> DocSource
Makes a Doc non-reflowable.
offset :: Doc -> IntSource
Returns the width of a Doc.
height :: Doc -> IntSource
Returns the height of a block or other Doc.
lblock :: Int -> Doc -> DocSource
lblock n d is a block of width n characters, with text derived from d and aligned to the left.
cblock :: Int -> Doc -> DocSource
Like lblock but aligned centered.
rblock :: Int -> Doc -> DocSource
Like lblock but aligned to the right.
(<>) :: Doc -> Doc -> DocSource
a b is the result of concatenating a with b.
(<+>) :: Doc -> Doc -> DocSource
Concatenate a list of Docs, putting breakable spaces between them.
($$) :: Doc -> Doc -> DocSource
a $$ b puts a above b.
($+$) :: Doc -> Doc -> DocSource
a $$ b puts a above b, with a blank line between.
isEmpty :: Doc -> BoolSource
True if the document is empty.
empty :: DocSource
The empty document.
cat :: [Doc] -> DocSource
Concatenate a list of Docs.
hcat :: [Doc] -> DocSource
Same as cat.
hsep :: [Doc] -> DocSource
Same as cat, but putting breakable spaces between the Docs.
vcat :: [Doc] -> DocSource
List version of $$.
vsep :: [Doc] -> DocSource
List version of $+$.
inside :: Doc -> Doc -> Doc -> DocSource
Encloses a Doc inside a start and end Doc.
braces :: Doc -> DocSource
Puts a Doc in curly braces.
brackets :: Doc -> DocSource
Puts a Doc in square brackets.
parens :: Doc -> DocSource
Puts a Doc in parentheses.
quotes :: Doc -> DocSource
Wraps a Doc in single quotes.
doubleQuotes :: Doc -> DocSource
Wraps a Doc in double quotes.
Produced by Haddock version 2.6.1