~jaro/balkon

63d8526d8e3d53eb77bc3aa193066616fcff97eb — Jaro 1 year, 24 days ago 96f9cb9 v0.3.0.0
Fix documentation: missing Paginable.
2 files changed, 4 insertions(+), 1 deletions(-)

M lib/Data/Text/ParagraphLayout.hs
M src/Data/Text/ParagraphLayout/Internal/Paginable.hs
M lib/Data/Text/ParagraphLayout.hs => lib/Data/Text/ParagraphLayout.hs +1 -0
@@ 23,6 23,7 @@ module Data.Text.ParagraphLayout
        , pageOrphans
        , pageWidows
        )
    , Paginable
    , Paragraph (Paragraph)
    , ParagraphLayout (ParagraphLayout, paragraphRect, spanLayouts)
    , ParagraphOptions

M src/Data/Text/ParagraphLayout/Internal/Paginable.hs => src/Data/Text/ParagraphLayout/Internal/Paginable.hs +3 -1
@@ 61,6 61,7 @@ class Paginable pl where
    --   on both sides.
    paginate :: PageOptions -> pl -> (PageContinuity, pl, Maybe pl)

-- | Internal implementation of paginating a simple list of generic lines.
instance Line a => Paginable [a] where
    paginate opts ls = case paginateLines o w h1 h2 ls of
        (c, p, []) -> (c, p, Nothing)


@@ 71,7 72,8 @@ instance Line a => Paginable [a] where
            h1 = pageCurrentHeight opts
            h2 = pageNextHeight opts

-- | Break a paragraph in order to fit the given pagination constraints.
-- | Implementation of paginating a plain text paragraph layout.
-- Breaks the layout on page boundaries and automatically adjusts coordinates.
instance Paginable ParagraphLayout where
    paginate opts pl = case paginate opts (cutLines pl) of
        (c, p, Nothing) -> (c, mergeLines p, Nothing)