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

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

Text.GridTable.Trace

Description

Trace cells of a grid table.

Synopsis

- traceLines :: [Text] -> Maybe (ArrayTable [Text])
- data TraceInfo = TraceInfo {
  - gridRowSeps :: Set CharRow
  - gridColSeps :: Set CharCol
  - gridCorners :: Set CharIndex
  - gridCells :: Set CellTrace
  }
- initialTraceInfo :: TraceInfo
- tableFromTraceInfo :: TraceInfo -> [PartSeparator] -> Maybe [ColSpec] -> ArrayTable [Text]

# Documentation

traceLines :: [Text] -> Maybe (ArrayTable [Text]) Source #

Traces out the cells in the given lines and converts them to a table containing the bare cell lines.

data TraceInfo Source #

Info on the grid. Used to keep track of information collected while tracing a character grid. The set of cells is used as a kind of queue during parsing, while the other data is required to assemble the final table.

Constructors

TraceInfo |

Fields

- gridRowSeps :: Set CharRow
- gridColSeps :: Set CharCol
- gridCorners :: Set CharIndex
- gridCells :: Set CellTrace

initialTraceInfo :: TraceInfo Source #

Initial tracing info.

tableFromTraceInfo :: TraceInfo -> [PartSeparator] -> Maybe [ColSpec] -> ArrayTable [Text] Source #

Create a final grid table from line scanning data.