summaryrefslogtreecommitdiff
path: root/Pancake
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
parent9d7940ac07b1e1bf408d39df05305ef879f27729 (diff)
Refine documentation annotations and function names
Diffstat (limited to 'Pancake')
-rw-r--r--Pancake/Configuration.hs3
-rw-r--r--Pancake/Rendering.hs11
-rw-r--r--Pancake/Unclutter.hs3
3 files changed, 13 insertions, 4 deletions
diff --git a/Pancake/Configuration.hs b/Pancake/Configuration.hs
index 772725e..bfac392 100644
--- a/Pancake/Configuration.hs
+++ b/Pancake/Configuration.hs
@@ -115,7 +115,8 @@ instance Default Config where
curl = "curl --compressed -4 -L " ++
"-w \"\n-pancake-\nuri: %{url_effective}\ntype: %{content_type}\n\" "
--- | Loads configuration from an XDG config directory.
+-- | Loads configuration from a given 'FilePath', or from an XDG
+-- config directory. Writes a default one if it doesn't exist.
loadConfig :: MonadIO m => Maybe FilePath -> m Config
loadConfig mp = liftIO $ do
configPath <- case mp of
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
diff --git a/Pancake/Unclutter.hs b/Pancake/Unclutter.hs
index 06ce098..cf5132e 100644
--- a/Pancake/Unclutter.hs
+++ b/Pancake/Unclutter.hs
@@ -51,7 +51,8 @@ import Control.Exception
import Pancake.Common
import Pancake.Configuration
--- | Tries to unclutter a document.
+-- | Tries to unclutter a document by applying an XSLT if it's
+-- available.
tryUnclutter :: MonadIO m
=> [(Regex, String)]
-- ^ Obtained with 'prepareUnclutter'.