| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Text.Tabular.AsciiWide
Description
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 [WideBuilder]
- data Align
- emptyCell :: Cell
- textCell :: Align -> Text -> Cell
- cellWidth :: Cell -> Int
- render :: Bool -> (rh -> Text) -> (ch -> Text) -> (a -> Text) -> Table rh ch a -> Text
- renderTable :: TableOpts -> (rh -> Cell) -> (ch -> Cell) -> (a -> Cell) -> Table rh ch a -> Text
- renderTableB :: TableOpts -> (rh -> Cell) -> (ch -> Cell) -> (a -> Cell) -> Table rh ch a -> Builder
- renderRow :: TableOpts -> Header Cell -> Text
- renderRowB :: TableOpts -> Header Cell -> Builder
- verticalBar :: Bool -> Char
- leftBar :: Bool -> Bool -> Builder
- rightBar :: Bool -> Bool -> Builder
- midBar :: Bool -> Bool -> Builder
- doubleMidBar :: Bool -> Bool -> Builder
- renderColumns :: TableOpts -> [Int] -> Header Cell -> Builder
- renderHLine :: VPos -> Bool -> Bool -> [Int] -> Header a -> Properties -> [Builder]
- renderHLine' :: VPos -> Bool -> Bool -> Properties -> [Int] -> Header a -> Builder
- data VPos
- data HPos
- boxchar :: VPos -> HPos -> Properties -> Properties -> Bool -> Builder
- pick :: Text -> Text -> Bool -> Builder
- lineart :: Properties -> Properties -> Properties -> Properties -> Bool -> Builder
Documentation
The options to use for rendering a table.
Constructors
| TableOpts | |
Fields
| |
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.
render :: Bool -> (rh -> Text) -> (ch -> Text) -> (a -> Text) -> Table rh ch a -> Text Source #
Render a table according to common options, for backwards compatibility
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 | |
| -> Text |
Render a table according to various cell specifications>
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 | |
| -> Builder |
A version of renderTable which 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.
verticalBar :: Bool -> Char Source #
Arguments
| :: TableOpts | rendering options for the table |
| -> [Int] | max width for each column |
| -> Header Cell | |
| -> Builder |
We stop rendering on the shortest list!
renderHLine' :: VPos -> Bool -> Bool -> Properties -> [Int] -> Header a -> Builder Source #
boxchar :: VPos -> HPos -> Properties -> Properties -> Bool -> Builder Source #
lineart :: Properties -> Properties -> Properties -> Properties -> Bool -> Builder Source #