summaryrefslogtreecommitdiff
path: root/Pancake/Rendering.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-22 02:08:51 +0300
committerdefanor <defanor@uberspace.net>2017-12-22 02:08:51 +0300
commit8b97635c41c998e6190f89c9883b2dcac5d8df09 (patch)
tree26fbc721a48948954b893476a15a74d9219f4fed /Pancake/Rendering.hs
parent9d7940ac07b1e1bf408d39df05305ef879f27729 (diff)
Refine documentation annotations and function names
Diffstat (limited to 'Pancake/Rendering.hs')
-rw-r--r--Pancake/Rendering.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Pancake/Rendering.hs b/Pancake/Rendering.hs
index 5f7e31f..06181e3 100644
--- a/Pancake/Rendering.hs
+++ b/Pancake/Rendering.hs
@@ -96,11 +96,18 @@ data RS = RS { indentationLevel :: Int
-- | This is what gets rendered.
data RendererOutput = RLink URI
+ -- ^ An URI reference.
| RNote [RendererOutput]
+ -- ^ A note.
| RLine StyledLine
+ -- ^ A line to render.
| RIdentifier String Int
+ -- ^ An identifier.
| RBlock Int Int
- -- ^ number, start line, end line
+ -- ^ A fixed block's position (start line and end
+ -- line). These blocks reflect semantics and don't
+ -- vary as the terminal width changes, so they are
+ -- safe to rely on for position retention.
deriving (Show, Eq)
-- | Show a reference.
@@ -125,7 +132,7 @@ rIdentifiers [] = []
rIdentifiers (RIdentifier s i:xs) = (s, i) : rIdentifiers xs
rIdentifiers (_:xs) = rIdentifiers xs
--- | Extracts block positions.
+-- | Extracts fixed block positions.
rBlocks :: [RendererOutput] -> [(Int, Int)]
rBlocks [] = []
rBlocks (RBlock s e:xs) = (s, e) : rBlocks xs