aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Data.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Data.hs')
-rw-r--r--src/Text/Pandoc/Data.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Data.hs b/src/Text/Pandoc/Data.hs
new file mode 100644
index 000000000..df26f5412
--- /dev/null
+++ b/src/Text/Pandoc/Data.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE TemplateHaskell #-}
+
+module Text.Pandoc.Data (dataFiles) where
+
+import Data.FileEmbed
+import qualified Data.ByteString as B
+import System.FilePath (splitDirectories)
+import qualified System.FilePath.Posix as Posix
+
+-- We ensure that the data files are stored using Posix
+-- path separators (/), even on Windows.
+dataFiles :: [(FilePath, B.ByteString)]
+dataFiles = map (\(fp, contents) ->
+ (Posix.joinPath (splitDirectories fp), contents)) dataFiles'
+
+dataFiles' :: [(FilePath, B.ByteString)]
+dataFiles' = ("MANUAL.txt", $(embedFile "MANUAL.txt")) : $(embedDir "data")