From 1fa15c225b515e1fa1c6566f90f1be363a4d770f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Mar 2017 20:48:17 +0200 Subject: Revert "Use file-embed instead of hsb2hs to embed data files." This reverts commit 10d91c147968d2e4d63b99b5b0342624827f416f. --- src/Text/Pandoc/Data.hs | 17 ----------------- src/Text/Pandoc/Data.hsb | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 src/Text/Pandoc/Data.hs create mode 100644 src/Text/Pandoc/Data.hsb (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Data.hs b/src/Text/Pandoc/Data.hs deleted file mode 100644 index df26f5412..000000000 --- a/src/Text/Pandoc/Data.hs +++ /dev/null @@ -1,17 +0,0 @@ -{-# 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") diff --git a/src/Text/Pandoc/Data.hsb b/src/Text/Pandoc/Data.hsb new file mode 100644 index 000000000..02c109816 --- /dev/null +++ b/src/Text/Pandoc/Data.hsb @@ -0,0 +1,16 @@ +{-# LANGUAGE OverloadedStrings #-} +-- to be processed using hsb2hs +module Text.Pandoc.Data (dataFiles) where +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", %blob "MANUAL.txt") : %blobs "data" + -- cgit v1.2.3