summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Templates.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Templates.hs')
-rw-r--r--src/Text/Pandoc/Templates.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs
index 98eed7292..75989fbcd 100644
--- a/src/Text/Pandoc/Templates.hs
+++ b/src/Text/Pandoc/Templates.hs
@@ -52,6 +52,7 @@ import System.FilePath
import System.Directory
import Prelude hiding (readFile)
import System.IO.UTF8 (readFile)
+import Text.Pandoc.Shared (readDataFile)
import Paths_pandoc
-- | Get the default template, either from the application's user data
@@ -73,9 +74,8 @@ getTemplateFromUserDataDirectory format = E.try $ do
readFile templatePath
getTemplateFromCabalDataDirectory :: String -> IO (Either E.IOException String)
-getTemplateFromCabalDataDirectory format = E.try $ do
- templatePath <- getDataFileName $ "templates" </> format <.> "template"
- readFile templatePath
+getTemplateFromCabalDataDirectory format = E.try $
+ readDataFile $ "templates" </> format <.> "template"
-- | Renders a template
renderTemplate :: [(String,String)] -- ^ Assoc. list of values for variables