charon-0.1: Template
Safe HaskellSafe-Inferred
LanguageGHC2021

Charon.Data.PathData.Formatting

Description

Formats the default PathData.

Synopsis

Types

data PathDataFormat Source #

Determines how to format a textual PathData.

Constructors

FormatMultiline

Formats each file on its own line.

FormatTabular Coloring (Maybe ColFormat) (Maybe ColFormat)

Formats all fields on the same line.

FormatSingleline Coloring

Formats each entry on a single line, no table.

data ColFormat Source #

Constructors

ColFormatFixed Natural

Fixed length format.

ColFormatMax

Format the column according to its longest entry, if possible.

Instances

Instances details
Show ColFormat Source # 
Instance details

Defined in Charon.Data.PathData.Formatting

Eq ColFormat Source # 
Instance details

Defined in Charon.Data.PathData.Formatting

data Coloring Source #

Whether we should color list command.

Constructors

ColoringOn

Coloring on

ColoringOff

Coloring off

ColoringDetect

Attempt to detect if the terminal support colors.

Instances

Instances details
Show Coloring Source # 
Instance details

Defined in Charon.Data.PathData.Formatting

Eq Coloring Source # 
Instance details

Defined in Charon.Data.PathData.Formatting

Sort

data Sort Source #

How to sort the index list.

Constructors

Name

Sort by name.

Size

Sort by size.

Instances

Instances details
Show Sort Source # 
Instance details

Defined in Charon.Data.PathData.Formatting

Methods

showsPrec :: Int -> Sort -> ShowS #

show :: Sort -> String #

showList :: [Sort] -> ShowS #

Eq Sort Source # 
Instance details

Defined in Charon.Data.PathData.Formatting

Methods

(==) :: Sort -> Sort -> Bool #

(/=) :: Sort -> Sort -> Bool #

Format functions

Sorting

sortReverse :: (a -> b -> Ordering) -> a -> b -> Ordering Source #

Field lengths

minTableWidth :: Natural Source #

Minimum length needed to display the table.

reservedLineLen :: Natural Source #

For tabular formatting, this is the necessary width for the fixed columns:

type: 9 size: 7 created: 19 separators: 12

NOTE: The separators includes the adjacent whitespace i.e. one separator ' | ' counts for 3, and since we have 4 that makes 12.

This does not include the minimum necessary total space (i.e. minimum 4 for name and 8 for original).