{-# LANGUAGE TemplateHaskell #-}
module Text.Pandoc.Data.BakedIn (dataFiles) where
import qualified Data.ByteString as B
import Data.FileEmbed
import System.FilePath (splitDirectories)
import qualified System.FilePath.Posix as Posix
dataFiles :: [(FilePath, B.ByteString)]
dataFiles :: [(FilePath, ByteString)]
dataFiles = ((FilePath, ByteString) -> (FilePath, ByteString))
-> [(FilePath, ByteString)] -> [(FilePath, ByteString)]
forall a b. (a -> b) -> [a] -> [b]
map (\(FilePath
fp, ByteString
contents) ->
([FilePath] -> FilePath
Posix.joinPath (FilePath -> [FilePath]
splitDirectories FilePath
fp), ByteString
contents)) [(FilePath, ByteString)]
dataFiles'
dataFiles' :: [(FilePath, B.ByteString)]
dataFiles' :: [(FilePath, ByteString)]
dataFiles' = (FilePath
"MANUAL.txt", $(embedFile "MANUAL.txt")) (FilePath, ByteString)
-> [(FilePath, ByteString)] -> [(FilePath, ByteString)]
forall a. a -> [a] -> [a]
:
(FilePath
"docx/_rels/.rels", $(embedFile "data/docx/_rels/.rels")) (FilePath, ByteString)
-> [(FilePath, ByteString)] -> [(FilePath, ByteString)]
forall a. a -> [a] -> [a]
:
(FilePath
"pptx/_rels/.rels", $(embedFile "data/pptx/_rels/.rels")) (FilePath, ByteString)
-> [(FilePath, ByteString)] -> [(FilePath, ByteString)]
forall a. a -> [a] -> [a]
:
$(embedDir "data")