pandoc-0.42: Conversion between markup formatsContentsIndex
Text.Pandoc.Blocks
Portabilityportable
Stabilityalpha
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Description
Functions for the manipulation of fixed-width blocks of text. These are used in the construction of plain-text tables.
Synopsis
data TextBlock = TextBlock Int Int [String]
docToBlock :: Int -> Doc -> TextBlock
blockToDoc :: TextBlock -> Doc
widthOfBlock :: TextBlock -> Int
heightOfBlock :: TextBlock -> Int
hcatBlocks :: [TextBlock] -> TextBlock
hsepBlocks :: [TextBlock] -> TextBlock
centerAlignBlock :: TextBlock -> TextBlock
leftAlignBlock :: TextBlock -> TextBlock
rightAlignBlock :: TextBlock -> TextBlock
Documentation
data TextBlock
A fixed-width block of text. Parameters are width of block, height of block, and list of lines.
Constructors
TextBlock Int Int [String]
show/hide Instances
docToBlock
:: IntWidth of text block.
-> DocDoc to convert.
-> TextBlock
Convert a Doc element into a TextBlock with a specified width.
blockToDoc :: TextBlock -> Doc
Convert a TextBlock to a Doc element.
widthOfBlock :: TextBlock -> Int
Returns width of a TextBlock (number of columns).
heightOfBlock :: TextBlock -> Int
Returns height of a TextBlock (number of rows).
hcatBlocks :: [TextBlock] -> TextBlock
Concatenates a list of TextBlocks into a new TextBlock in which they appear side by side.
hsepBlocks :: [TextBlock] -> TextBlock
Like hcatBlocks, but inserts space between the TextBlocks.
centerAlignBlock :: TextBlock -> TextBlock
Centers the contents of a TextBlock within the block.
leftAlignBlock :: TextBlock -> TextBlock
Left-aligns the contents of a TextBlock within the block.
rightAlignBlock :: TextBlock -> TextBlock
Right-aligns the contents of a TextBlock within the block.
Produced by Haddock version 0.8