diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-23 08:14:23 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-23 19:26:39 -0800 |
commit | 9c299d282f943fd4db076b09b1901309e19308bd (patch) | |
tree | db5e529ca76072bccb6404e8c2918c9dc3e350b9 /src | |
parent | 7a0062a8d5d6f3ea8b754b23eb6af6f8e07a8102 (diff) | |
download | pandoc-9c299d282f943fd4db076b09b1901309e19308bd.tar.gz |
Added Text.Pandoc.Data (non-exported) if embed_data_files selected.
This module just exports the association list of embedded data files,
which is used by Shared.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Data.hs | 7 | ||||
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 9 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Data.hs b/src/Text/Pandoc/Data.hs new file mode 100644 index 000000000..441fa5913 --- /dev/null +++ b/src/Text/Pandoc/Data.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} +module Text.Pandoc.Data (dataFiles) where +import Data.FileEmbed +import qualified Data.ByteString as B + +dataFiles :: [(FilePath, B.ByteString)] +dataFiles = $(embedDir "data") diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 26b0e1b1d..e4b38acc7 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable, CPP, TemplateHaskell #-} +{-# LANGUAGE DeriveDataTypeable, CPP #-} {- Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu> @@ -103,7 +103,7 @@ import qualified Data.ByteString as B import Network.HTTP (findHeader, rspBody, simpleHTTP, RequestMethod(..), HeaderName(..), mkRequest) #ifdef EMBED_DATA_FILES -import Data.FileEmbed +import Text.Pandoc.Data (dataFiles) #else import Paths_pandoc (getDataFileName) #endif @@ -515,11 +515,6 @@ inDirectory path action = do setCurrentDirectory oldDir return result -#ifdef EMBED_DATA_FILES -dataFiles :: [(FilePath, B.ByteString)] -dataFiles = $(embedDir "data") -#endif - readDefaultDataFile :: FilePath -> IO B.ByteString readDefaultDataFile fname = #ifdef EMBED_DATA_FILES |