diff options
Diffstat (limited to 'Pancake')
-rw-r--r-- | Pancake/Configuration.hs | 3 | ||||
-rw-r--r-- | Pancake/Rendering.hs | 11 | ||||
-rw-r--r-- | Pancake/Unclutter.hs | 3 |
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'. |