Text.GridTable

gridtables-0.1.0.0: Parser for reStructuredText-style grid tables.

Copyright | © 2022 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <albert@zeitkraut.de>
Safe Haskell | None
Language | Haskell2010

Text.GridTable

Contents

- Parse from character stream
- List-based representation

Description

Parse reStructuredText-style grid tables.

Synopsis

- module Text.GridTable.ArrayTable
- gridTable :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m (ArrayTable [Text])
- data Cell a = Cell {
  - cellContent :: a
  - cellRowSpan :: RowSpan
  - cellColSpan :: ColSpan
  }
- rows :: ArrayTable a -> [[Cell a]]

# Documentation

module Text.GridTable.ArrayTable

# Parse from character stream

gridTable :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m (ArrayTable [Text]) #

Parses a grid table.

# List-based representation

data Cell a #

Raw grid table cell

Constructors

Cell |
Fields cellContent :: a cellRowSpan :: RowSpan cellColSpan :: ColSpan

#### Instances

Instances details

Show a => Show (Cell a) # |
Instance details Defined in Text.GridTable Methods showsPrec :: Int -> Cell a -> ShowS # show :: Cell a -> String # showList :: [Cell a] -> ShowS #
Eq a => Eq (Cell a) # |
Instance details Defined in Text.GridTable Methods (==) :: Cell a -> Cell a -> Bool # (/=) :: Cell a -> Cell a -> Bool #
Ord a => Ord (Cell a) # |
Instance details Defined in Text.GridTable Methods compare :: Cell a -> Cell a -> Ordering # (<) :: Cell a -> Cell a -> Bool # (<=) :: Cell a -> Cell a -> Bool # (>) :: Cell a -> Cell a -> Bool # (>=) :: Cell a -> Cell a -> Bool # max :: Cell a -> Cell a -> Cell a # min :: Cell a -> Cell a -> Cell a #

rows :: ArrayTable a -> [[Cell a]] #

Returns the rows of a grid table as lists of simple cells.