aboutsummaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 22:40:59 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 22:40:59 +0000
commited1535de108594db53b0fd86724b2dff8165ae8c (patch)
tree6d0bfa76da87c7e73bfb96165e7f1b1ae6b05f64 /src/pandoc.hs
parentbdd448ea2cf41324a63bd09771b5ac553e65f540 (diff)
downloadpandoc-ed1535de108594db53b0fd86724b2dff8165ae8c.tar.gz
Added --reference-odt option.
This allows the user to customized the styles used in pandoc-generated ODTs. The user may also put a default reference.odt in the ~/.pandoc directory. We have removed the old data/odt directory and replaced it with a reference.odt. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1760 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index e85553141..9f402ede8 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -151,6 +151,7 @@ data Opt = Opt
, optXeTeX :: Bool -- ^ Format latex for xetex
, optSmart :: Bool -- ^ Use smart typography
, optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
+ , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
, optDumpArgs :: Bool -- ^ Output command-line arguments
, optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
, optStrict :: Bool -- ^ Use strict markdown syntax
@@ -188,6 +189,7 @@ defaultOpts = Opt
, optXeTeX = False
, optSmart = False
, optHTMLMathMethod = PlainMath
+ , optReferenceODT = Nothing
, optDumpArgs = False
, optIgnoreArgs = False
, optStrict = False
@@ -429,6 +431,13 @@ options =
"STRING")
"" -- "String to prefix to HTML window title"
+ , Option "" ["reference-odt"]
+ (ReqArg
+ (\arg opt -> do
+ return opt { optReferenceODT = Just arg })
+ "FILENAME")
+ "" -- "Path of custom reference.odt"
+
, Option "D" ["print-default-template"]
(ReqArg
(\arg _ -> do
@@ -582,6 +591,7 @@ main = do
, optXeTeX = xetex
, optSmart = smart
, optHTMLMathMethod = mathMethod
+ , optReferenceODT = referenceODT
, optDumpArgs = dumpArgs
, optIgnoreArgs = ignoreArgs
, optStrict = strict
@@ -717,9 +727,9 @@ main = do
#endif
let writerOutput = writer writerOptions doc' ++ "\n"
-
+
case writerName' of
- "odt" -> saveOpenDocumentAsODT outputFile sourceDirRelative writerOutput
+ "odt" -> saveOpenDocumentAsODT outputFile sourceDirRelative referenceODT writerOutput
_ -> if outputFile == "-"
then putStr writerOutput
else writeFile outputFile writerOutput