hable-0.3.1: customizable pretty printer library for tables

Safe HaskellSafe
LanguageHaskell2010

Hable.Config

Description

This module offers the Config data type (constructor) to configure hable.

For further configuration, you might also want to take a look at the various pre-defined styles of Hable. The default configuration uses Unicode, so you might want to take a look at OrgMode and Colored8, too.

Synopsis

Documentation

data Config style Source #

Hable Configuration.

Constructors

Config 

Fields

  • hLineStyle :: Integer -> Integer -> Maybe style

    Horizontal line style.

    The first argument is the index of the last possible horizontal line (i.e. number of rows + 1).

    The second argument receives the index of any horizontal line.

    If Nothing is returned, the horizontal line will be collapsed / hidden here. If Just a style is returned, this style will be used for the horizontal parts of the box character (BoxChar).

  • vLineStyle :: Integer -> Integer -> Maybe style

    Vertical line style.

    The first argument is the index of the last possible vertical line (i.e. number of rows + 1).

    The second argument receives the index of any vertical line.

    If Nothing is returned, the vertical line will be collapsed / hidden here. If Just a style is returned, this style will be used for the vertical parts of the box character (BoxChar).

  • hAlign :: Integer -> HAxis

    Horizontal Alignment.

    The argument is the index of any row.

    If HLeft is returned, the content of the cells in this row will be aligned to the left. If HCenter is returned, the content of the cells in this row will be centered. If HRight is returned, the content of the cells in this row will be aligned to the right.

  • vAlign :: Integer -> VAxis

    Vertical Alignment in case of multi-line cells.

    The argument is the index of any column.

    If VTop is returned, the content of the cells in this column will be aligned to the top. If VCenter is returned, the content of the cells in this column will be centered. If VBottom is returned, the content of the cells in this column will be aligned to the bottom.

  • hPadding :: Integer

    Horizontal padding.

    The number of spaces to be inserted between the cell content and the vertical lines on both the left and the right side of a cell.

  • charset :: BoxChar style -> String

    Charset.

    The argument is a styled box character BoxChar. The style of it was calculated by hable using the hLineStyle and vLineStyle properties of your configuration.

    Returns a character (as string) to be used for the lines.

defaultConfig :: Config UnicodeStyle Source #

The default configuration uses Unicode box characters.