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)