Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Common definitions (and support functions) for rendering a
KVITable
.
Synopsis
- data RenderConfig = RenderConfig {
- hideBlankRows :: Bool
- hideBlankCols :: Bool
- equisizedCols :: Bool
- sortKeyVals :: Bool
- colStackAt :: Maybe Key
- rowRepeat :: Bool
- rowGroup :: [Key]
- caption :: Maybe Text
- defaultRenderConfig :: RenderConfig
- sortWithNums :: [KeyVal] -> [KeyVal]
Documentation
data RenderConfig Source #
The RenderConfig
specifies the various controls and
configurations used when rendering a KVITable
in various formats.
The RenderConfig
is global t oall formats, although some of the
fields in the RenderConfig
will be ignored as not-applicable by
some formats.
RenderConfig | |
|
defaultRenderConfig :: RenderConfig Source #
Returns the default rendering configuration, to be used with a
format-specific render
call.
sortWithNums :: [KeyVal] -> [KeyVal] Source #
Sorting for KeyVals. If the value starts or ends with a digit, then this should do a rough numeric sort on the expectation that the digits represent a version or some other numeric value. As an approximation of a numeric sort, sort by word size and then string value. This will result in [ "1", "2", "10", "50", "400" ], but would fail with [ "v1.0", "v2.0", "v3.0", "v2.0.5", "v1.0.0.3" ], but it's a reasonably fast heuristic and probably better than a straight ascii sort.
This function is used by the KVITable
rendering functions.