2018-03-18 10:46:28 -07:00
|
|
|
{-# LANGUAGE NoImplicitPrelude #-}
|
2017-04-02 23:10:10 +02:00
|
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
|
2013-01-23 08:14:23 -08:00
|
|
|
module Text.Pandoc.Data (dataFiles) where
|
2017-04-02 23:10:10 +02:00
|
|
|
|
2018-03-18 10:46:28 -07:00
|
|
|
import Prelude
|
2013-01-23 08:14:23 -08:00
|
|
|
import qualified Data.ByteString as B
|
2017-10-27 20:28:29 -07:00
|
|
|
import Data.FileEmbed
|
2017-03-26 20:41:35 +02:00
|
|
|
import System.FilePath (splitDirectories)
|
2015-10-17 22:03:12 -07:00
|
|
|
import qualified System.FilePath.Posix as Posix
|
2013-01-23 08:14:23 -08:00
|
|
|
|
2015-10-17 22:03:12 -07:00
|
|
|
-- We ensure that the data files are stored using Posix
|
|
|
|
-- path separators (/), even on Windows.
|
2013-01-23 08:14:23 -08:00
|
|
|
dataFiles :: [(FilePath, B.ByteString)]
|
2015-10-17 22:03:12 -07:00
|
|
|
dataFiles = map (\(fp, contents) ->
|
|
|
|
(Posix.joinPath (splitDirectories fp), contents)) dataFiles'
|
|
|
|
|
|
|
|
dataFiles' :: [(FilePath, B.ByteString)]
|
2017-04-02 23:29:58 +02:00
|
|
|
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")) :
|
2017-04-02 23:29:58 +02:00
|
|
|
$(embedDir "data")
|