| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Text.Tabular.AsciiWide
Description
Text.Tabular.AsciiArt from tabular-0.2.2.7, modified to treat wide characters as double width.
Synopsis
- empty :: Table rh ch a
- col :: ch -> [a] -> SemiTable ch a
- data Header h
- = Header h
- | Group Properties [Header h]
- data Table rh ch a = Table (Header rh) (Header ch) [[a]]
- data SemiTable h a = SemiTable (Header h) [a]
- data Properties
- headerContents :: Header h -> [h]
- zipHeader :: h -> [h] -> Header a -> Header (h, a)
- flattenHeader :: Header h -> [Either Properties h]
- squish :: (Properties -> b -> b) -> (h -> b) -> Header h -> [b]
- colH :: ch -> SemiTable ch a
- row :: rh -> [a] -> SemiTable rh a
- rowH :: rh -> SemiTable rh a
- beside :: Properties -> Table rh ch a -> SemiTable ch a -> Table rh ch a
- below :: Properties -> 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
- (+.+) :: 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
- data TableOpts = TableOpts {
- prettyTable :: Bool
- tableBorders :: Bool
- borderSpaces :: Bool
- render :: Show a => Bool -> (rh -> Text) -> (ch -> Text) -> (a -> Text) -> Table rh ch a -> Text
- renderTable :: Show a => TableOpts -> (rh -> Cell) -> (ch -> Cell) -> (a -> Cell) -> Table rh ch a -> Text
- renderTableB :: Show a => TableOpts -> (rh -> Cell) -> (ch -> Cell) -> (a -> Cell) -> Table rh ch a -> Builder
- renderTableByRowsB :: Show a => TableOpts -> ([ch] -> [Cell]) -> ((rh, [a]) -> (Cell, [Cell])) -> Table rh ch a -> Builder
- renderRow :: TableOpts -> Header Cell -> Text
- renderRowB :: TableOpts -> Header Cell -> Builder
- renderColumns :: TableOpts -> [Int] -> Header Cell -> Builder
- data Cell = Cell Align [WideBuilder]
- data Align
- emptyCell :: Cell
- textCell :: Align -> Text -> Cell
- textsCell :: Align -> [Text] -> Cell
- cellWidth :: Cell -> Int
- concatTables :: Properties -> Table rh ch a -> Table rh ch2 a -> Table rh ch a
Documentation
data Properties #
Constructors
| NoLine | |
| SingleLine | |
| DoubleLine |
Instances
| Show Properties | |
Defined in Text.Tabular | |
headerContents :: Header h -> [h] #
flattenHeader :: Header h -> [Either Properties h] #
squish :: (Properties -> b -> b) -> (h -> b) -> Header h -> [b] #
The options to use for rendering a table.
Constructors
| TableOpts | |
Fields
| |
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
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>
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.
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.
Arguments
| :: TableOpts | rendering options for the table |
| -> [Int] | max width for each column |
| -> Header Cell | |
| -> Builder |
We stop rendering on the shortest list!
How to align text in a cell
Constructors
| TopRight | |
| BottomRight | |
| BottomLeft | |
| TopLeft |
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.
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.