From ff991d1e2151479ff7dc15aba9c17251ff060408 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 2 Apr 2017 23:10:10 +0200 Subject: Revert "Revert "Use file-embed instead of hsb2hs to embed data files."" This reverts commit 1fa15c225b515e1fa1c6566f90f1be363a4d770f. --- src/Text/Pandoc/Data.hs | 17 +++++++++++++++++ src/Text/Pandoc/Data.hsb | 16 ---------------- 2 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 src/Text/Pandoc/Data.hs delete mode 100644 src/Text/Pandoc/Data.hsb (limited to 'src/Text') diff --git a/src/Text/Pandoc/Data.hs b/src/Text/Pandoc/Data.hs new file mode 100644 index 000000000..df26f5412 --- /dev/null +++ b/src/Text/Pandoc/Data.hs @@ -0,0 +1,17 @@ +{-# 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 deleted file mode 100644 index 02c109816..000000000 --- a/src/Text/Pandoc/Data.hsb +++ /dev/null @@ -1,16 +0,0 @@ -{-# 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