pandoc/src/Text/Pandoc/Data.hs

25 lines
895 B
Haskell
Raw Normal View History

{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module Text.Pandoc.Data (dataFiles) where
import Prelude
import qualified Data.ByteString as B
import Data.FileEmbed
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")) :
-- handle the hidden file separately, since embedDir doesn't
-- include it:
("docx/_rels/.rels", $(embedFile "data/docx/_rels/.rels")) :
2017-12-13 20:48:24 -08:00
("pptx/_rels/.rels", $(embedFile "data/pptx/_rels/.rels")) :
$(embedDir "data")