| pandoc-1.6: Conversion between markup formats | Source code | Contents | Index

Text.Pandoc.Blocks

Portability | portable
Stability | alpha
Maintainer | John 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 | Source

A fixed-width block of text. Parameters are width of block, height of block, and list of lines.
Constructors

TextBlock Int Int [String] |

Instances

Show TextBlock

docToBlock | Source

:: Int | Width of text block.
-> Doc | `Doc` to convert.
-> TextBlock |
Convert a `Doc` element into a `TextBlock` with a specified width.

blockToDoc :: TextBlock -> Doc | Source

Convert a `TextBlock` to a `Doc` element.

widthOfBlock :: TextBlock -> Int | Source

Returns width of a `TextBlock` (number of columns).

heightOfBlock :: TextBlock -> Int | Source

Returns height of a `TextBlock` (number of rows).

hcatBlocks :: [TextBlock] -> TextBlock | Source

Concatenates a list of `TextBlock`s into a new `TextBlock` in which they appear side by side.

hsepBlocks :: [TextBlock] -> TextBlock | Source

Like `hcatBlocks`, but inserts space between the `TextBlock`s.

centerAlignBlock :: TextBlock -> TextBlock | Source

Centers the contents of a `TextBlock` within the block.

leftAlignBlock :: TextBlock -> TextBlock | Source

Left-aligns the contents of a `TextBlock` within the block.

rightAlignBlock :: TextBlock -> TextBlock | Source

Right-aligns the contents of a `TextBlock` within the block.
Produced by Haddock version 2.4.2