module Text.Table.Definition (
TableType (..)
, CaptionPos (..)
, Align (..)
, Cell (..)
, Row (..)
, Column (..)
, Header (..)
, Table (..)
, Span
, Width
, Gutter
, Lines
, Caption
, AtrName
, AtrValue
, Atrs
) where
type Span = Int
type Width = Int
type Gutter = Int
type Lines = [String]
type Caption = String
type AtrName = String
type AtrValue = String
type Atrs = [(AtrName, AtrValue)]
data TableType = Simple
| Multiline
| Grid
| Pipe
deriving (TableType -> TableType -> Bool
(TableType -> TableType -> Bool)
-> (TableType -> TableType -> Bool) -> Eq TableType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableType -> TableType -> Bool
$c/= :: TableType -> TableType -> Bool
== :: TableType -> TableType -> Bool
$c== :: TableType -> TableType -> Bool
Eq, Int -> TableType -> ShowS
[TableType] -> ShowS
TableType -> String
(Int -> TableType -> ShowS)
-> (TableType -> String)
-> ([TableType] -> ShowS)
-> Show TableType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableType] -> ShowS
$cshowList :: [TableType] -> ShowS
show :: TableType -> String
$cshow :: TableType -> String
showsPrec :: Int -> TableType -> ShowS
$cshowsPrec :: Int -> TableType -> ShowS
Show)
data CaptionPos = BeforeTable
| AfterTable
deriving (Int -> CaptionPos -> ShowS
[CaptionPos] -> ShowS
CaptionPos -> String
(Int -> CaptionPos -> ShowS)
-> (CaptionPos -> String)
-> ([CaptionPos] -> ShowS)
-> Show CaptionPos
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionPos] -> ShowS
$cshowList :: [CaptionPos] -> ShowS
show :: CaptionPos -> String
$cshow :: CaptionPos -> String
showsPrec :: Int -> CaptionPos -> ShowS
$cshowsPrec :: Int -> CaptionPos -> ShowS
Show)
data Align = LeftAlign
| RightAlign
| CenterAlign
| DefaultAlign
deriving (Int -> Align -> ShowS
[Align] -> ShowS
Align -> String
(Int -> Align -> ShowS)
-> (Align -> String) -> ([Align] -> ShowS) -> Show Align
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Align] -> ShowS
$cshowList :: [Align] -> ShowS
show :: Align -> String
$cshow :: Align -> String
showsPrec :: Int -> Align -> ShowS
$cshowsPrec :: Int -> Align -> ShowS
Show)
data Cell = Cell Span Width Align Lines
deriving (Int -> Cell -> ShowS
[Cell] -> ShowS
Cell -> String
(Int -> Cell -> ShowS)
-> (Cell -> String) -> ([Cell] -> ShowS) -> Show Cell
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Cell] -> ShowS
$cshowList :: [Cell] -> ShowS
show :: Cell -> String
$cshow :: Cell -> String
showsPrec :: Int -> Cell -> ShowS
$cshowsPrec :: Int -> Cell -> ShowS
Show)
data Row = Row [Cell]
deriving (Int -> Row -> ShowS
[Row] -> ShowS
Row -> String
(Int -> Row -> ShowS)
-> (Row -> String) -> ([Row] -> ShowS) -> Show Row
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Row] -> ShowS
$cshowList :: [Row] -> ShowS
show :: Row -> String
$cshow :: Row -> String
showsPrec :: Int -> Row -> ShowS
$cshowsPrec :: Int -> Row -> ShowS
Show)
data Column = Column Width Align
deriving (Int -> Column -> ShowS
[Column] -> ShowS
Column -> String
(Int -> Column -> ShowS)
-> (Column -> String) -> ([Column] -> ShowS) -> Show Column
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Column] -> ShowS
$cshowList :: [Column] -> ShowS
show :: Column -> String
$cshow :: Column -> String
showsPrec :: Int -> Column -> ShowS
$cshowsPrec :: Int -> Column -> ShowS
Show)
data = Row
|
deriving (Int -> Header -> ShowS
[Header] -> ShowS
Header -> String
(Int -> Header -> ShowS)
-> (Header -> String) -> ([Header] -> ShowS) -> Show Header
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Header] -> ShowS
$cshowList :: [Header] -> ShowS
show :: Header -> String
$cshow :: Header -> String
showsPrec :: Int -> Header -> ShowS
$cshowsPrec :: Int -> Header -> ShowS
Show)
data Table = Table Caption [Column] Header [Row]
deriving (Int -> Table -> ShowS
[Table] -> ShowS
Table -> String
(Int -> Table -> ShowS)
-> (Table -> String) -> ([Table] -> ShowS) -> Show Table
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Table] -> ShowS
$cshowList :: [Table] -> ShowS
show :: Table -> String
$cshow :: Table -> String
showsPrec :: Int -> Table -> ShowS
$cshowsPrec :: Int -> Table -> ShowS
Show)