Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Text.Layout.Table.Justify
Contents
Description
Produce justified text, which is spread over multiple rows. For a simple
cut, chunksOf
from the split
package is best suited.
Synopsis
- justify :: Int -> [String] -> [String]
- justifyText :: Int -> String -> [String]
- data Line = Line {
- lineLength :: Int
- lineWordCount :: Int
- lineWords :: [String]
- fitWords :: Int -> [String] -> [Line]
- concatPadLine :: Int -> Line -> String
- dimorphicSummands :: Int -> Int -> [Int]
- dimorphicSummandsBy :: (Int -> a) -> Int -> Int -> [a]
- mixedDimorphicSummandsBy :: (Int -> a) -> Int -> Int -> [a]
Text justification
justify :: Int -> [String] -> [String] Source #
Fits as many words on a line as possible depending on the given width. Every line, except the last one, gets equally filled with spaces between the words as far as possible.
Intermediate representation for a line of words.
Constructors
Line | |
Fields
|
Arguments
:: Int | The number of characters available per line. |
-> [String] | The words to join with whitespaces. |
-> [Line] | The list of line information. |
Fit as much words on a line as possible. Produce a list of the length of the line with one space between the words, the word count and the words.
Cutting below word boundaries is not yet supported.
Join the words on a line together by filling it with spaces in between.