git.iko.soy/typeable/pandoc
on master help sign in
Added --data-dir option.
eb851a4fiddlosopher
README+24−31
@@ -330,16 +330,9 @@ For further documentation, see the `pandoc(1)` man page.
330 of an ODT produced using pandoc. The contents of the reference ODT
330 of an ODT produced using pandoc. The contents of the reference ODT
331 are ignored, but its stylesheets are used in the new ODT. If no
331 are ignored, but its stylesheets are used in the new ODT. If no
332 reference ODT is specified on the command line, pandoc will look
332 reference ODT is specified on the command line, pandoc will look
333− for a file `reference.odt` in
333+ for a file `reference.odt` in the user data directory (see
334−
335− $HOME/.pandoc
336−
337− (on unix) or
338−
339− C:\Documents And Settings\USERNAME\Application Data\pandoc
340−
341− (on Windows). If this is not found either, sensible defaults will be
334+ `--data-dir`, below). If it is not found there, sensible defaults
342− used.
335+ will be used.
343
336
344`-D` or `--print-default-template` *format*
337`-D` or `--print-default-template` *format*
345: prints the default template for an output *format*. (See `-t`
338: prints the default template for an output *format*. (See `-t`
@@ -432,6 +425,20 @@ For further documentation, see the `pandoc(1)` man page.
432 `perl,numberLines` or `haskell`. Multiple classes may be separated
425 `perl,numberLines` or `haskell`. Multiple classes may be separated
433 by spaces or commas.
426 by spaces or commas.
434
427
428+`--data-dir`*=directory*
429+: specifies the user data directory to search for pandoc data files.
430+ If this option is not specified, the default user data directory
431+ will be used:
432+
433+ $HOME/.pandoc
434+
435+ in unix and
436+
437+ C:\Documents And Settings\USERNAME\Application Data\pandoc
438+
439+ in Windows. A reference ODT, `templates` directory, `s5` directory
440+ placed in this directory will override pandoc's normal defaults.
441+
435`--dump-args`
442`--dump-args`
436: is intended to make it easier to create wrapper scripts that use
443: is intended to make it easier to create wrapper scripts that use
437 Pandoc. It causes Pandoc to dump information about the arguments
444 Pandoc. It causes Pandoc to dump information about the arguments
@@ -483,15 +490,8 @@ document. To see the default template that is used, just type
483where `FORMAT` is the name of the output format. A custom template
490where `FORMAT` is the name of the output format. A custom template
484can be specified using the `--template` option. You can also override
491can be specified using the `--template` option. You can also override
485the system default templates for a given output format `FORMAT`
492the system default templates for a given output format `FORMAT`
486−by putting a file `FORMAT.template` in
493+by putting a file `templates/FORMAT.template` in the user data
487−
494+directory (see `--data-dir`, above).
488− $HOME/.pandoc/templates
489−
490−(on unix) or
491−
492− C:\Documents And Settings\USERNAME\Application Data\pandoc\templates
493−
494−(on Windows).
495
495
496Templates may contain *variables*. Variable names are sequences of
496Templates may contain *variables*. Variable names are sequences of
497alphanumerics, `-`, and `_`, starting with a letter. A variable name
497alphanumerics, `-`, and `_`, starting with a letter. A variable name
@@ -1231,18 +1231,11 @@ Alternatively, you may use `-s` together with the `--template`
1231option to specify a custom template.
1231option to specify a custom template.
1232
1232
1233You can change the style of the slides by putting customized CSS files
1233You can change the style of the slides by putting customized CSS files
1234−in
1234+in `$DATADIR/s5/default`, where `$DATADIR` is the user data directory
1235−
1236− $HOME/.pandoc/s5/default
1237−
1238−(on unix) or
1239−
1240− C:\Documents And Settings\USERNAME\Application Data\pandoc\reference.odt
1241−
1242−(on Windows). The originals may be found in pandoc's system
1235+(see `--data-dir`, above). The originals may be found in pandoc's system
1243−data directory (generally `$CABALDIR/pandoc-VERSION/s5/default`).
1236+data directory (generally `$CABALDIR/pandoc-VERSION/s5/default`). Pandoc
1244−Pandoc will look there for any files it does not find in the user's
1237+will look there for any files it does not find in the user data
1245−pandoc data directory.
1238+directory.
1246
1239
1247Literate Haskell support
1240Literate Haskell support
1248========================
1241========================
man/man1/pandoc.1.md+18−7
@@ -207,9 +207,8 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
207 of an ODT produced using pandoc. The contents of the reference ODT
207 of an ODT produced using pandoc. The contents of the reference ODT
208 are ignored, but its stylesheets are used in the new ODT. If no
208 are ignored, but its stylesheets are used in the new ODT. If no
209 reference ODT is specified on the command line, pandoc will look
209 reference ODT is specified on the command line, pandoc will look
210− for `$HOME/.pandoc/reference.odt` (on unix) or
210+ for a file `reference.odt` in the user data directory (see
211− `C:\Documents And Settings\USERNAME\Application Data\pandoc\reference.odt`
212− (on Windows). If this is not found either, sensible defaults will be
211+ `--data-dir`). If this is not found either, sensible defaults will be
213 used.
212 used.
214
213
215-D *FORMAT*, \--print-default-template=*FORMAT*
214-D *FORMAT*, \--print-default-template=*FORMAT*
@@ -219,6 +218,20 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
219-T *STRING*, \--title-prefix=*STRING*
218-T *STRING*, \--title-prefix=*STRING*
220: Specify *STRING* as a prefix to the HTML window title.
219: Specify *STRING* as a prefix to the HTML window title.
221
220
221+\--data-dir*=DIRECTORY*
222+: Specify the user data directory to search for pandoc data files.
223+ If this option is not specified, the default user data directory
224+ will be used:
225+
226+ $HOME/.pandoc
227+
228+ in unix and
229+
230+ C:\Documents And Settings\USERNAME\Application Data\pandoc
231+
232+ in Windows. A reference ODT, `templates` directory, `s5` directory
233+ placed in this directory will override pandoc's normal defaults.
234+
222\--dump-args
235\--dump-args
223: Print information about command-line arguments to *stdout*, then exit.
236: Print information about command-line arguments to *stdout*, then exit.
224 The first line of output contains the name of the output file specified
237 The first line of output contains the name of the output file specified
@@ -256,10 +269,8 @@ document. To see the default template that is used, just type
256where `FORMAT` is the name of the output format. A custom template
269where `FORMAT` is the name of the output format. A custom template
257can be specified using the `--template` option. You can also override
270can be specified using the `--template` option. You can also override
258the system default templates for a given output format `FORMAT`
271the system default templates for a given output format `FORMAT`
259−by putting a file `FORMAT.template` in `$HOME/.pandoc/templates`
272+by putting a file `templates/FORMAT.template` in the user data
260−(on unix) or
273+directory (see `--data-dir`, below).
261−`C:\Documents And Settings\USERNAME\Application Data\pandoc\templates`
262−(on Windows).
263
274
264Templates may contain *variables*. Variable names are sequences of
275Templates may contain *variables*. Variable names are sequences of
265alphanumerics, `-`, and `_`, starting with a letter. A variable name
276alphanumerics, `-`, and `_`, starting with a letter. A variable name
src/Text/Pandoc/LaTeXMathML.hs+4−4
@@ -5,9 +5,9 @@ import System.FilePath ( (</>) )
5import Text.Pandoc.Shared (readDataFile)
5import Text.Pandoc.Shared (readDataFile)
6
6
7-- | String containing LaTeXMathML javascript.
7-- | String containing LaTeXMathML javascript.
8−latexMathMLScript :: IO String
8+latexMathMLScript :: FilePath -> IO String
9−latexMathMLScript = do
9+latexMathMLScript datadir = do
10− jsCom <- readDataFile $ "data" </> "LaTeXMathML.js.comment"
10+ jsCom <- readDataFile datadir $ "data" </> "LaTeXMathML.js.comment"
11− jsPacked <- readDataFile $ "data" </> "LaTeXMathML.js.packed"
11+ jsPacked <- readDataFile datadir $ "data" </> "LaTeXMathML.js.packed"
12 return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
12 return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
13 "</script>\n"
13 "</script>\n"
src/Text/Pandoc/ODT.hs+4−4
@@ -42,18 +42,18 @@ import System.Directory
42import Control.Monad (liftM)
42import Control.Monad (liftM)
43
43
44-- | Produce an ODT file from OpenDocument XML.
44-- | Produce an ODT file from OpenDocument XML.
45+saveOpenDocumentAsODT :: FilePath -- ^ Path of user data directory
45−saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
46+ -> FilePath -- ^ Pathname of ODT file to be produced.
46 -> FilePath -- ^ Relative directory of source file.
47 -> FilePath -- ^ Relative directory of source file.
47 -> Maybe FilePath -- ^ Path specified by --reference-odt
48 -> Maybe FilePath -- ^ Path specified by --reference-odt
48 -> String -- ^ OpenDocument XML contents.
49 -> String -- ^ OpenDocument XML contents.
49 -> IO ()
50 -> IO ()
50−saveOpenDocumentAsODT destinationODTPath sourceDirRelative mbRefOdt xml = do
51+saveOpenDocumentAsODT datadir destinationODTPath sourceDirRelative mbRefOdt xml = do
51 refArchive <- liftM toArchive $
52 refArchive <- liftM toArchive $
52 case mbRefOdt of
53 case mbRefOdt of
53 Just f -> B.readFile f
54 Just f -> B.readFile f
54 Nothing -> do
55 Nothing -> do
55− userDataDir <- getAppUserDataDirectory "pandoc"
56− let userRefOdt = userDataDir </> "reference.odt"
56+ let userRefOdt = datadir </> "reference.odt"
57 userRefOdtExists <- doesFileExist userRefOdt
57 userRefOdtExists <- doesFileExist userRefOdt
58 if userRefOdtExists
58 if userRefOdtExists
59 then B.readFile userRefOdt
59 then B.readFile userRefOdt
src/Text/Pandoc/Shared.hs+6−6
@@ -1044,9 +1044,9 @@ inDirectory path action = do
1044 setCurrentDirectory oldDir
1044 setCurrentDirectory oldDir
1045 return result
1045 return result
1046
1046
1047−-- | Read file from user data directory or, if not found there, from
1047+-- | Read file from specified user data directory or, if not found there, from
1048−-- Cabal data directory. On unix the user data directory is @$HOME/.pandoc@.
1048+-- Cabal data directory.
1049−readDataFile :: FilePath -> IO String
1049+readDataFile :: FilePath -> FilePath -> IO String
1050−readDataFile fname = do
1050+readDataFile userDir fname = catch
1051− userDir <- getAppUserDataDirectory "pandoc"
1051+ (readFile $ userDir </> fname)
1052− catch (readFile $ userDir </> fname) (\_ -> getDataFileName fname >>= readFile)
1052+ (\_ -> getDataFileName fname >>= readFile)
src/Text/Pandoc/Templates.hs+7−15
@@ -66,8 +66,7 @@ You may optionally specify separators using @$sep$@:
66
66
67module Text.Pandoc.Templates ( renderTemplate
67module Text.Pandoc.Templates ( renderTemplate
68 , TemplateTarget
68 , TemplateTarget
69− , getTemplate
69+ , getTemplate ) where
70− , getDefaultTemplate) where
71
70
72import Text.ParserCombinators.Parsec
71import Text.ParserCombinators.Parsec
73import Control.Monad (liftM, when, forM)
72import Control.Monad (liftM, when, forM)
@@ -77,7 +76,7 @@ import Data.List (intercalate, intersperse)
77import Text.PrettyPrint (text, Doc)
76import Text.PrettyPrint (text, Doc)
78import Text.XHtml (primHtml, Html)
77import Text.XHtml (primHtml, Html)
79import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
78import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
80−import System.Directory
79+import Text.Pandoc.Shared (readDataFile)
81-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
80-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
82-- So we use System.IO.UTF8 only if we have an earlier version
81-- So we use System.IO.UTF8 only if we have an earlier version
83#if MIN_VERSION_base(4,2,0)
82#if MIN_VERSION_base(4,2,0)
@@ -88,25 +87,18 @@ import System.IO.UTF8 ( readFile )
88import Paths_pandoc (getDataFileName)
87import Paths_pandoc (getDataFileName)
89
88
90-- | Get a template for the specified writer.
89-- | Get a template for the specified writer.
91−getTemplate :: Bool -- ^ Allow override from user's application data directory?
90+getTemplate :: (Maybe FilePath) -- ^ User data directory to search first
92− -> String -- ^ Name of writer
91+ -> String -- ^ Name of writer
93 -> IO (Either E.IOException String)
92 -> IO (Either E.IOException String)
94getTemplate _ "native" = return $ Right ""
93getTemplate _ "native" = return $ Right ""
95getTemplate user "s5" = getTemplate user "html"
94getTemplate user "s5" = getTemplate user "html"
96getTemplate user "odt" = getTemplate user "opendocument"
95getTemplate user "odt" = getTemplate user "opendocument"
97getTemplate user writer = do
96getTemplate user writer = do
98 let format = takeWhile (/='+') writer -- strip off "+lhs" if present
97 let format = takeWhile (/='+') writer -- strip off "+lhs" if present
99− userDir <- getAppUserDataDirectory "pandoc"
100 let fname = "templates" </> format <.> "template"
98 let fname = "templates" </> format <.> "template"
101− hasUserTemplate <- doesFileExist (userDir </> fname)
102− E.try $ if user && hasUserTemplate
99+ E.try $ case user of
103− then readFile $ userDir </> fname
100+ Just d -> readDataFile d fname
104− else getDataFileName fname >>= readFile
101+ Nothing -> getDataFileName fname >>= readFile
105−
106−-- | Get the default template, either from the application's user data
107−-- directory (~/.pandoc on unix) or from the cabal data directory.
108−getDefaultTemplate :: String -> IO (Either E.IOException String)
109−getDefaultTemplate = getTemplate True
110
102
111data TemplateState = TemplateState Int [(String,String)]
103data TemplateState = TemplateState Int [(String,String)]
112
104
src/Text/Pandoc/Writers/S5.hs+16−16
@@ -44,30 +44,30 @@ import Text.XHtml.Strict
44import System.FilePath ( (</>) )
44import System.FilePath ( (</>) )
45import Data.List ( intercalate )
45import Data.List ( intercalate )
46
46
47−s5HeaderIncludes :: IO String
47+s5HeaderIncludes :: FilePath -> IO String
48−s5HeaderIncludes = do
48+s5HeaderIncludes datadir = do
49− c <- s5CSS
49+ c <- s5CSS datadir
50− j <- s5Javascript
50+ j <- s5Javascript datadir
51 return $ s5Meta ++ c ++ j
51 return $ s5Meta ++ c ++ j
52
52
53s5Meta :: String
53s5Meta :: String
54s5Meta = "<!-- configuration parameters -->\n<meta name=\"defaultView\" content=\"slideshow\" />\n<meta name=\"controlVis\" content=\"hidden\" />\n"
54s5Meta = "<!-- configuration parameters -->\n<meta name=\"defaultView\" content=\"slideshow\" />\n<meta name=\"controlVis\" content=\"hidden\" />\n"
55
55
56−s5Javascript :: IO String
56+s5Javascript :: FilePath -> IO String
57−s5Javascript = do
57+s5Javascript datadir = do
58− jsCom <- readDataFile $ "s5" </> "default" </> "slides.js.comment"
58+ jsCom <- readDataFile datadir $ "s5" </> "default" </> "slides.js.comment"
59− jsPacked <- readDataFile $ "s5" </> "default" </> "slides.js.packed"
59+ jsPacked <- readDataFile datadir $ "s5" </> "default" </> "slides.js.packed"
60 return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
60 return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
61 "</script>\n"
61 "</script>\n"
62
62
63−s5CSS :: IO String
63+s5CSS :: FilePath -> IO String
64−s5CSS = do
64+s5CSS datadir = do
65− s5CoreCSS <- readDataFile $ "s5" </> "default" </> "s5-core.css"
65+ s5CoreCSS <- readDataFile datadir $ "s5" </> "default" </> "s5-core.css"
66− s5FramingCSS <- readDataFile $ "s5" </> "default" </> "framing.css"
66+ s5FramingCSS <- readDataFile datadir $ "s5" </> "default" </> "framing.css"
67− s5PrettyCSS <- readDataFile $ "s5" </> "default" </> "pretty.css"
67+ s5PrettyCSS <- readDataFile datadir $ "s5" </> "default" </> "pretty.css"
68− s5OperaCSS <- readDataFile $ "s5" </> "default" </> "opera.css"
68+ s5OperaCSS <- readDataFile datadir $ "s5" </> "default" </> "opera.css"
69− s5OutlineCSS <- readDataFile $ "s5" </> "default" </> "outline.css"
69+ s5OutlineCSS <- readDataFile datadir $ "s5" </> "default" </> "outline.css"
70− s5PrintCSS <- readDataFile $ "s5" </> "default" </> "print.css"
70+ s5PrintCSS <- readDataFile datadir $ "s5" </> "default" </> "print.css"
71 return $ "<style type=\"text/css\" media=\"projection\" id=\"slideProj\">\n" ++ s5CoreCSS ++ "\n" ++ s5FramingCSS ++ "\n" ++ s5PrettyCSS ++ "\n</style>\n<style type=\"text/css\" media=\"projection\" id=\"operaFix\">\n" ++ s5OperaCSS ++ "\n</style>\n<style type=\"text/css\" media=\"screen\" id=\"outlineStyle\">\n" ++ s5OutlineCSS ++ "\n</style>\n<style type=\"text/css\" media=\"print\" id=\"slidePrint\">\n" ++ s5PrintCSS ++ "\n</style>\n"
71 return $ "<style type=\"text/css\" media=\"projection\" id=\"slideProj\">\n" ++ s5CoreCSS ++ "\n" ++ s5FramingCSS ++ "\n" ++ s5PrettyCSS ++ "\n</style>\n<style type=\"text/css\" media=\"projection\" id=\"operaFix\">\n" ++ s5OperaCSS ++ "\n</style>\n<style type=\"text/css\" media=\"screen\" id=\"outlineStyle\">\n" ++ s5OutlineCSS ++ "\n</style>\n<style type=\"text/css\" media=\"print\" id=\"slidePrint\">\n" ++ s5PrintCSS ++ "\n</style>\n"
72
72
73s5Links :: String
73s5Links :: String
src/pandoc.hs+20−6
@@ -44,6 +44,7 @@ import System.Console.GetOpt
44import Data.Maybe ( fromMaybe )
44import Data.Maybe ( fromMaybe )
45import Data.Char ( toLower )
45import Data.Char ( toLower )
46import Data.List ( intercalate, isSuffixOf )
46import Data.List ( intercalate, isSuffixOf )
47+import System.Directory ( getAppUserDataDirectory )
47import System.IO ( stdout, stderr )
48import System.IO ( stdout, stderr )
48-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
49-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
49-- So we use System.IO.UTF8 only if we have an earlier version
50-- So we use System.IO.UTF8 only if we have an earlier version
@@ -162,6 +163,7 @@ data Opt = Opt
162 , optEmailObfuscation :: ObfuscationMethod
163 , optEmailObfuscation :: ObfuscationMethod
163 , optIdentifierPrefix :: String
164 , optIdentifierPrefix :: String
164 , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
165 , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
166+ , optDataDir :: Maybe FilePath
165#ifdef _CITEPROC
167#ifdef _CITEPROC
166 , optBiblioFile :: String
168 , optBiblioFile :: String
167 , optBiblioFormat :: String
169 , optBiblioFormat :: String
@@ -200,6 +202,7 @@ defaultOpts = Opt
200 , optEmailObfuscation = JavascriptObfuscation
202 , optEmailObfuscation = JavascriptObfuscation
201 , optIdentifierPrefix = ""
203 , optIdentifierPrefix = ""
202 , optIndentedCodeClasses = []
204 , optIndentedCodeClasses = []
205+ , optDataDir = Nothing
203#ifdef _CITEPROC
206#ifdef _CITEPROC
204 , optBiblioFile = []
207 , optBiblioFile = []
205 , optBiblioFormat = []
208 , optBiblioFormat = []
@@ -438,7 +441,7 @@ options =
438 , Option "D" ["print-default-template"]
441 , Option "D" ["print-default-template"]
439 (ReqArg
442 (ReqArg
440 (\arg _ -> do
443 (\arg _ -> do
441− templ <- getDefaultTemplate arg
444+ templ <- getTemplate Nothing arg
442 case templ of
445 case templ of
443 Right t -> hPutStr stdout t
446 Right t -> hPutStr stdout t
444 Left e -> error $ show e
447 Left e -> error $ show e
@@ -462,6 +465,12 @@ options =
462 "FILENAME")
465 "FILENAME")
463 ""
466 ""
464#endif
467#endif
468+ , Option "" ["data-dir"]
469+ (ReqArg
470+ (\arg opt -> return opt { optDataDir = Just arg })
471+ "DIRECTORY") -- "Directory containing pandoc data files."
472+ ""
473+
465 , Option "" ["dump-args"]
474 , Option "" ["dump-args"]
466 (NoArg
475 (NoArg
467 (\opt -> return opt { optDumpArgs = True }))
476 (\opt -> return opt { optDumpArgs = True }))
@@ -598,6 +607,7 @@ main = do
598 , optEmailObfuscation = obfuscationMethod
607 , optEmailObfuscation = obfuscationMethod
599 , optIdentifierPrefix = idPrefix
608 , optIdentifierPrefix = idPrefix
600 , optIndentedCodeClasses = codeBlockClasses
609 , optIndentedCodeClasses = codeBlockClasses
610+ , optDataDir = mbDataDir
601#ifdef _CITEPROC
611#ifdef _CITEPROC
602 , optBiblioFile = biblioFile
612 , optBiblioFile = biblioFile
603 , optBiblioFormat = biblioFormat
613 , optBiblioFormat = biblioFormat
@@ -619,6 +629,10 @@ main = do
619
629
620 let sources = if ignoreArgs then [] else args
630 let sources = if ignoreArgs then [] else args
621
631
632+ datadir <- case mbDataDir of
633+ Just d -> return d
634+ Nothing -> getAppUserDataDirectory "pandoc"
635+
622 -- assign reader and writer based on options and filenames
636 -- assign reader and writer based on options and filenames
623 let readerName' = if null readerName
637 let readerName' = if null readerName
624 then defaultReaderName sources
638 then defaultReaderName sources
@@ -636,7 +650,7 @@ main = do
636 Just r -> return r
650 Just r -> return r
637 Nothing -> error ("Unknown writer: " ++ writerName')
651 Nothing -> error ("Unknown writer: " ++ writerName')
638
652
639− templ <- getDefaultTemplate writerName'
653+ templ <- getTemplate (Just datadir) writerName'
640 let defaultTemplate = case templ of
654 let defaultTemplate = case templ of
641 Right t -> t
655 Right t -> t
642 Left e -> error (show e)
656 Left e -> error (show e)
@@ -654,13 +668,13 @@ main = do
654
668
655 variables' <- if writerName' == "s5" && standalone'
669 variables' <- if writerName' == "s5" && standalone'
656 then do
670 then do
657− inc <- s5HeaderIncludes
671+ inc <- s5HeaderIncludes datadir
658 return $ ("header-includes", inc) : variables
672 return $ ("header-includes", inc) : variables
659 else return variables
673 else return variables
660
674
661 variables'' <- case mathMethod of
675 variables'' <- case mathMethod of
662 LaTeXMathML Nothing -> do
676 LaTeXMathML Nothing -> do
663− s <- latexMathMLScript
677+ s <- latexMathMLScript datadir
664 return $ ("latexmathml-script", s) : variables'
678 return $ ("latexmathml-script", s) : variables'
665 _ -> return variables'
679 _ -> return variables'
666
680
@@ -731,9 +745,9 @@ main = do
731#endif
745#endif
732
746
733 let writerOutput = writer writerOptions doc' ++ "\n"
747 let writerOutput = writer writerOptions doc' ++ "\n"
734−
748+
735 case writerName' of
749 case writerName' of
736− "odt" -> saveOpenDocumentAsODT outputFile sourceDirRelative referenceODT writerOutput
750+ "odt" -> saveOpenDocumentAsODT datadir outputFile sourceDirRelative referenceODT writerOutput
737 _ -> if outputFile == "-"
751 _ -> if outputFile == "-"
738 then putStr writerOutput
752 then putStr writerOutput
739 else writeFile outputFile writerOutput
753 else writeFile outputFile writerOutput