aboutsummaryrefslogtreecommitdiff
path: root/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utils.hs')
-rw-r--r--Utils.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/Utils.hs b/Utils.hs
index fa1bc09..1f39694 100644
--- a/Utils.hs
+++ b/Utils.hs
@@ -28,7 +28,7 @@ import System.Directory
, doesDirectoryExist
, getDirectoryContents
)
-import System.FilePath ((</>), splitDirectories, takeDirectory)
+import System.FilePath (splitDirectories, takeDirectory)
import Text.Pandoc.Definition
import qualified Text.Pandoc.Walk
import Types
@@ -96,6 +96,16 @@ unAbsolute = dropWhile (== '/')
withPandocBlocks :: ([Block] -> [Block]) -> Pandoc -> Pandoc
withPandocBlocks f (Pandoc meta blocks) = Pandoc meta (f blocks)
+infixr 5 </>
+
+a </> b@('/':_) =
+ error
+ $ "internal error: unchecked concatenation of absolute path: "
+ ++ a
+ ++ " </> "
+ ++ b
+a </> b = (System.FilePath.</>) a b
+
-- | Get all contents of a directory. (Interned from Hakyll.)
getRecursiveContents ::
(FilePath -> IO Bool) -- ^ Ignore this file/directory