Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Text.Tabular.AsciiArt from tabular-0.2.2.7, modified to treat wide characters as double width.
Synopsis
- data TableOpts = TableOpts {
- prettyTable :: Bool
- tableBorders :: Bool
- borderSpaces :: Bool
- data Cell = Cell Align [(String, Int)]
- data Align
- emptyCell :: Cell
- alignCell :: Align -> String -> Cell
- cellWidth :: Cell -> Int
- render :: Bool -> (rh -> String) -> (ch -> String) -> (a -> String) -> Table rh ch a -> String
- renderTable :: TableOpts -> (rh -> Cell) -> (ch -> Cell) -> (a -> Cell) -> Table rh ch a -> String
- renderRow :: TableOpts -> Header Cell -> String
- verticalBar :: Bool -> Char
- leftBar :: Bool -> Bool -> String
- rightBar :: Bool -> Bool -> String
- midBar :: Bool -> Bool -> String
- doubleMidBar :: Bool -> Bool -> String
- renderColumns :: TableOpts -> [Int] -> Header Cell -> String
- renderHLine :: VPos -> Bool -> Bool -> [Int] -> Header a -> Properties -> [String]
- renderHLine' :: VPos -> Bool -> Bool -> Properties -> [Int] -> Header a -> String
- data VPos
- data HPos
- boxchar :: VPos -> HPos -> Properties -> Properties -> Bool -> String
- pick :: String -> String -> Bool -> String
- lineart :: Properties -> Properties -> Properties -> Properties -> Bool -> String
Documentation
The options to use for rendering a table.
TableOpts | |
|
Cell contents along an alignment
How to align text in a cell
alignCell :: Align -> String -> Cell Source #
Create a single-line cell from the given contents with its natural width.
render :: Bool -> (rh -> String) -> (ch -> String) -> (a -> String) -> Table rh ch a -> String Source #
Render a table according to common options, for backwards compatibility
:: 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.
verticalBar :: Bool -> Char Source #
:: TableOpts | rendering options for the table |
-> [Int] | max width for each column |
-> Header Cell | |
-> String |
We stop rendering on the shortest list!
renderHLine' :: VPos -> Bool -> Bool -> Properties -> [Int] -> Header a -> String Source #
boxchar :: VPos -> HPos -> Properties -> Properties -> Bool -> String Source #
lineart :: Properties -> Properties -> Properties -> Properties -> Bool -> String Source #