lib: Expose textConcatBottomPadded.
This commit is contained in:
parent
217bfc5e74
commit
5d664fc528
@ -34,7 +34,7 @@ module Hledger.Utils.Text
|
|||||||
formatText,
|
formatText,
|
||||||
-- -- * multi-line layout
|
-- -- * multi-line layout
|
||||||
textConcatTopPadded,
|
textConcatTopPadded,
|
||||||
-- concatBottomPadded,
|
textConcatBottomPadded,
|
||||||
-- concatOneLine,
|
-- concatOneLine,
|
||||||
-- vConcatLeftAligned,
|
-- vConcatLeftAligned,
|
||||||
-- vConcatRightAligned,
|
-- vConcatRightAligned,
|
||||||
@ -201,18 +201,11 @@ textConcatTopPadded :: [Text] -> Text
|
|||||||
textConcatTopPadded = TL.toStrict . renderRow def{tableBorders=False, borderSpaces=False}
|
textConcatTopPadded = TL.toStrict . renderRow def{tableBorders=False, borderSpaces=False}
|
||||||
. Group NoLine . map (Header . textCell BottomLeft)
|
. Group NoLine . map (Header . textCell BottomLeft)
|
||||||
|
|
||||||
-- -- | Join several multi-line strings as side-by-side rectangular strings of the same height, bottom-padded.
|
-- | Join several multi-line strings as side-by-side rectangular strings of the same height, bottom-padded.
|
||||||
-- -- Treats wide characters as double width.
|
-- Treats wide characters as double width.
|
||||||
-- concatBottomPadded :: [String] -> String
|
textConcatBottomPadded :: [Text] -> Text
|
||||||
-- concatBottomPadded strs = intercalate "\n" $ map concat $ transpose padded
|
textConcatBottomPadded = TL.toStrict . renderRow def{tableBorders=False, borderSpaces=False}
|
||||||
-- where
|
. Group NoLine . map (Header . textCell TopLeft)
|
||||||
-- lss = map lines strs
|
|
||||||
-- h = maximum $ map length lss
|
|
||||||
-- ypad ls = ls ++ replicate (difforzero h (length ls)) ""
|
|
||||||
-- xpad ls = map (padRightWide w) ls where w | null ls = 0
|
|
||||||
-- | otherwise = maximum $ map strWidth ls
|
|
||||||
-- padded = map (xpad . ypad) lss
|
|
||||||
|
|
||||||
|
|
||||||
-- -- | Join multi-line strings horizontally, after compressing each of
|
-- -- | Join multi-line strings horizontally, after compressing each of
|
||||||
-- -- them to a single line with a comma and space between each original line.
|
-- -- them to a single line with a comma and space between each original line.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user