pandoc/src/Text/Pandoc/Data.hs
2017-04-02 23:10:10 +02:00

17 lines
582 B
Haskell

{-# 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")