From 63d8526d8e3d53eb77bc3aa193066616fcff97eb Mon Sep 17 00:00:00 2001 From: Jaro Date: Wed, 12 Apr 2023 22:41:01 +0200 Subject: [PATCH] Fix documentation: missing Paginable. --- lib/Data/Text/ParagraphLayout.hs | 1 + src/Data/Text/ParagraphLayout/Internal/Paginable.hs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Data/Text/ParagraphLayout.hs b/lib/Data/Text/ParagraphLayout.hs index b7367c4..fe2369d 100644 --- a/lib/Data/Text/ParagraphLayout.hs +++ b/lib/Data/Text/ParagraphLayout.hs @@ -23,6 +23,7 @@ module Data.Text.ParagraphLayout , pageOrphans , pageWidows ) + , Paginable , Paragraph (Paragraph) , ParagraphLayout (ParagraphLayout, paragraphRect, spanLayouts) , ParagraphOptions diff --git a/src/Data/Text/ParagraphLayout/Internal/Paginable.hs b/src/Data/Text/ParagraphLayout/Internal/Paginable.hs index 44f4cb8..285fb5c 100644 --- a/src/Data/Text/ParagraphLayout/Internal/Paginable.hs +++ b/src/Data/Text/ParagraphLayout/Internal/Paginable.hs @@ -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) -- 2.30.2