git.iko.soy/typeable/pandoc
on master help sign in
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

commit9fed26181f7cc8aa0f3bd2a01332204389c8979c authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 18 Jan 2010, 05:06 (17 years ago) parent00da8f4
2 files changed+11−11
src/Text/Pandoc/Templates.hs+9−9 src/pandoc.hs+2−2
src/Text/Pandoc/Templates.hs+9−9
@@ -66,7 +66,7 @@ You may optionally specify separators using @$sep$@:
6666
6767module Text.Pandoc.Templates ( renderTemplate
6868 , TemplateTarget
69− , getTemplate ) where
69+ , getDefaultTemplate ) where
7070
7171import Text.ParserCombinators.Parsec
7272import Control.Monad (liftM, when, forM)
@@ -86,14 +86,14 @@ import System.IO.UTF8 ( readFile )
8686#endif
8787import Paths_pandoc (getDataFileName)
8888
89−-- | Get a template for the specified writer.
90−getTemplate :: (Maybe FilePath) -- ^ User data directory to search first
91− -> String -- ^ Name of writer
92− -> IO (Either E.IOException String)
93−getTemplate _ "native" = return $ Right ""
94−getTemplate user "s5" = getTemplate user "html"
95−getTemplate user "odt" = getTemplate user "opendocument"
96−getTemplate user writer = do
89+-- | Get default template for the specified writer.
90+getDefaultTemplate :: (Maybe FilePath) -- ^ User data directory to search first
91+ -> String -- ^ Name of writer
92+ -> IO (Either E.IOException String)
93+getDefaultTemplate _ "native" = return $ Right ""
94+getDefaultTemplate user "s5" = getDefaultTemplate user "html"
95+getDefaultTemplate user "odt" = getDefaultTemplate user "opendocument"
96+getDefaultTemplate user writer = do
9797 let format = takeWhile (/='+') writer -- strip off "+lhs" if present
9898 let fname = "templates" </> format <.> "template"
9999 E.try $ case user of
src/pandoc.hs+2−2
@@ -441,7 +441,7 @@ options =
441441 , Option "D" ["print-default-template"]
442442 (ReqArg
443443 (\arg _ -> do
444− templ <- getTemplate Nothing arg
444+ templ <- getDefaultTemplate Nothing arg
445445 case templ of
446446 Right t -> hPutStr stdout t
447447 Left e -> error $ show e
@@ -650,7 +650,7 @@ main = do
650650 Just r -> return r
651651 Nothing -> error ("Unknown writer: " ++ writerName')
652652
653− templ <- getTemplate (Just datadir) writerName'
653+ templ <- getDefaultTemplate (Just datadir) writerName'
654654 let defaultTemplate = case templ of
655655 Right t -> t
656656 Left e -> error (show e)