hledger-lib-1.40: A 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 Header h #

Constructors

Header h 
Group Properties [Header h] 

Instances

Instances details
Functor Header 
Instance details

Defined in Text.Tabular

Methods

fmap :: (a -> b) -> Header a -> Header b

(<$) :: a -> Header b -> Header a

Show h => Show (Header h) 
Instance details

Defined in Text.Tabular

Methods

showsPrec :: Int -> Header h -> ShowS

show :: Header h -> String

showList :: [Header h] -> ShowS

data Properties #

Constructors

NoLine 
SingleLine 
DoubleLine 

Instances

Instances details
Show Properties 
Instance details

Defined in Text.Tabular

Methods

showsPrec :: Int -> Properties -> ShowS

show :: Properties -> String

showList :: [Properties] -> ShowS

empty :: Table rh ch a #

beside :: Properties -> Table rh ch a -> SemiTable ch a -> Table rh ch a #

row :: rh -> [a] -> SemiTable rh a #

data Table rh ch a #

Constructors

Table (Header rh) (Header ch) [[a]] 

Instances

Instances details
(Show rh, Show ch, Show a) => Show (Table rh ch a) 
Instance details

Defined in Text.Tabular

Methods

showsPrec :: Int -> Table rh ch a -> ShowS

show :: Table rh ch a -> String

showList :: [Table rh ch a] -> ShowS

zipHeader :: h -> [h] -> Header a -> Header (h, a) #

headerContents :: Header h -> [h] #

flattenHeader :: Header h -> [Either Properties h] #

data SemiTable h a #

Constructors

SemiTable (Header h) [a] 

Instances

Instances details
(Show h, Show a) => Show (SemiTable h a) 
Instance details

Defined in Text.Tabular

Methods

showsPrec :: Int -> SemiTable h a -> ShowS

show :: SemiTable h a -> String

showList :: [SemiTable h a] -> ShowS

(+----+) :: Table rh ch a -> SemiTable rh a -> Table rh ch a #

(+.+) :: Table rh ch a -> SemiTable rh a -> Table rh ch a #

(+====+) :: Table rh ch a -> SemiTable rh a -> Table rh ch a #

(^..^) :: Table rh ch a -> SemiTable ch a -> Table rh ch a #

(^|^) :: Table rh ch a -> SemiTable ch a -> Table rh ch a #

(^||^) :: Table rh ch a -> SemiTable ch a -> Table rh ch a #

below :: Properties -> Table rh ch a -> SemiTable rh a -> Table rh ch a #

col :: ch -> [a] -> SemiTable ch a #

colH :: ch -> SemiTable ch a #

rowH :: rh -> SemiTable rh a #

squish :: (Properties -> b -> b) -> (h -> b) -> Header h -> [b] #

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

Methods

showsPrec :: Int -> TableOpts -> ShowS

show :: TableOpts -> String

showList :: [TableOpts] -> ShowS

Default TableOpts Source # 
Instance details

Defined in Text.Tabular.AsciiWide

Methods

def :: TableOpts

render :: Show a => Bool -> (rh -> Text) -> (ch -> Text) -> (a -> Text) -> Table rh ch a -> Text Source #

Render a table according to common options, for backwards compatibility

renderTable Source #

Arguments

:: Show a 
=> 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 
-> Text 

Render a table according to various cell specifications>

renderTableB Source #

Arguments

:: Show a 
=> 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 
-> Builder 

A version of renderTable which returns the underlying Builder.

renderTableByRowsB Source #

Arguments

:: Show a 
=> TableOpts

Options controlling Table rendering

-> ([ch] -> [Cell])

Rendering function for column headers

-> ((rh, [a]) -> (Cell, [Cell]))

Rendering function for row and row header

-> Table rh ch a 
-> Builder 

A version of renderTable that operates on rows (including the row of column headers) and returns the underlying Builder.

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

Render a single row according to cell specifications.

renderRowB :: TableOpts -> Header Cell -> Builder Source #

A version of renderRow which returns the underlying Builder.

renderColumns Source #

Arguments

:: TableOpts

rendering options for the table

-> [Int]

max width for each column

-> Header Cell 
-> Builder 

We stop rendering on the shortest list!

data Cell Source #

Cell contents along an alignment

Constructors

Cell Align [WideBuilder] 

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

textCell :: Align -> Text -> Cell Source #

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

textsCell :: Align -> [Text] -> Cell Source #

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

cellWidth :: Cell -> Int Source #

Return the width of a Cell.

concatTables :: Properties -> Table rh ch a -> Table rh ch2 a -> Table rh ch a Source #

Add the second table below the first, discarding its column headings.