From 9fed26181f7cc8aa0f3bd2a01332204389c8979c Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Mon, 18 Jan 2010 05:06:08 +0000 Subject: Rename getTemplate -> getDefaultTemplate. (One reason is that getTemplate conflicts with a function in yst.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1820 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Templates.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs index 59fbe8e73..9f677608d 100644 --- a/src/Text/Pandoc/Templates.hs +++ b/src/Text/Pandoc/Templates.hs @@ -66,7 +66,7 @@ You may optionally specify separators using @$sep$@: module Text.Pandoc.Templates ( renderTemplate , TemplateTarget - , getTemplate ) where + , getDefaultTemplate ) where import Text.ParserCombinators.Parsec import Control.Monad (liftM, when, forM) @@ -86,14 +86,14 @@ import System.IO.UTF8 ( readFile ) #endif import Paths_pandoc (getDataFileName) --- | Get a template for the specified writer. -getTemplate :: (Maybe FilePath) -- ^ User data directory to search first - -> String -- ^ Name of writer - -> IO (Either E.IOException String) -getTemplate _ "native" = return $ Right "" -getTemplate user "s5" = getTemplate user "html" -getTemplate user "odt" = getTemplate user "opendocument" -getTemplate user writer = do +-- | Get default template for the specified writer. +getDefaultTemplate :: (Maybe FilePath) -- ^ User data directory to search first + -> String -- ^ Name of writer + -> IO (Either E.IOException String) +getDefaultTemplate _ "native" = return $ Right "" +getDefaultTemplate user "s5" = getDefaultTemplate user "html" +getDefaultTemplate user "odt" = getDefaultTemplate user "opendocument" +getDefaultTemplate user writer = do let format = takeWhile (/='+') writer -- strip off "+lhs" if present let fname = "templates" format <.> "template" E.try $ case user of -- cgit v1.2.3