hledger-lib-1.20.1: A reusable library providing the core functionality of hledger
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Tabular.AsciiWide

Description

Text.Tabular.AsciiArt from tabular-0.2.2.7, modified to treat wide characters as double width.

Synopsis

Documentation

data TableOpts Source #

The options to use for rendering a table.

Constructors

TableOpts 

Fields

Instances

Instances details
Show TableOpts Source # 
Instance details

Defined in Text.Tabular.AsciiWide

Default TableOpts Source # 
Instance details

Defined in Text.Tabular.AsciiWide

Methods

def :: TableOpts #

data Cell Source #

Cell contents along an alignment

Constructors

Cell Align [(String, Int)] 

Instances

Instances details
Show Cell Source # 
Instance details

Defined in Text.Tabular.AsciiWide

Methods

showsPrec :: Int -> Cell -> ShowS #

show :: Cell -> String #

showList :: [Cell] -> ShowS #

data Align Source #

How to align text in a cell

Instances

Instances details
Show Align Source # 
Instance details

Defined in Text.Tabular.AsciiWide

Methods

showsPrec :: Int -> Align -> ShowS #

show :: Align -> String #

showList :: [Align] -> ShowS #

alignCell :: Align -> String -> Cell Source #

Create a single-line cell from the given contents with its natural width.

cellWidth :: Cell -> Int Source #

Return the width of a Cell.

render :: Bool -> (rh -> String) -> (ch -> String) -> (a -> String) -> Table rh ch a -> String Source #

Render a table according to common options, for backwards compatibility

renderTable Source #

Arguments

:: TableOpts

Options controlling Table rendering

-> (rh -> Cell)

Rendering function for row headers

-> (ch -> Cell)

Rendering function for column headers

-> (a -> Cell)

Function determining the string and width of a cell

-> Table rh ch a 
-> String 

Render a table according to various cell specifications

renderRow :: TableOpts -> Header Cell -> String Source #

Render a single row according to cell specifications.

renderColumns Source #

Arguments

:: TableOpts

rendering options for the table

-> [Int]

max width for each column

-> Header Cell 
-> String 

We stop rendering on the shortest list!

renderHLine Source #

Arguments

:: VPos 
-> Bool

show outer borders

-> Bool

pretty

-> [Int]

width specifications

-> Header a 
-> Properties 
-> [String] 

data VPos Source #

Constructors

VT 
VM 
VB 

data HPos Source #

Constructors

HL 
HM 
HR