aboutsummaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-07-04 16:56:17 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-07-05 00:06:27 -0700
commite3dcf8e3bf438371961b6cc18e98f1637c30c97f (patch)
treebc536af5a3dc9a0649adb8cc4de74929b3785f89 /src/pandoc.hs
parent15cc99c61714f3018cbf734656657282d61c860f (diff)
downloadpandoc-e3dcf8e3bf438371961b6cc18e98f1637c30c97f.tar.gz
Added writerEPUBMetadata field and --epub-metadata option.
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index 892409871..36c6b2cda 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -153,6 +153,7 @@ data Opt = Opt
, optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
, optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
, optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet
+ , optEPUBMetadata :: String -- ^ EPUB metadata
, optDumpArgs :: Bool -- ^ Output command-line arguments
, optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
, optStrict :: Bool -- ^ Use strict markdown syntax
@@ -192,6 +193,7 @@ defaultOpts = Opt
, optHTMLMathMethod = PlainMath
, optReferenceODT = Nothing
, optEPUBStylesheet = Nothing
+ , optEPUBMetadata = ""
, optDumpArgs = False
, optIgnoreArgs = False
, optStrict = False
@@ -470,6 +472,14 @@ options =
"FILENAME")
"" -- "Path of epub.css"
+ , Option "" ["epub-metadata"]
+ (ReqArg
+ (\arg opt -> do
+ text <- UTF8.readFile arg
+ return opt { optEPUBMetadata = text })
+ "FILENAME")
+ "" -- "Path of epub metadata file"
+
, Option "D" ["print-default-template"]
(ReqArg
(\arg _ -> do
@@ -631,6 +641,7 @@ main = do
, optHTMLMathMethod = mathMethod
, optReferenceODT = referenceODT
, optEPUBStylesheet = epubStylesheet
+ , optEPUBMetadata = epubMetadata
, optDumpArgs = dumpArgs
, optIgnoreArgs = ignoreArgs
, optStrict = strict
@@ -751,6 +762,7 @@ main = do
then defaultTemplate
else template,
writerVariables = variables'',
+ writerEPUBMetadata = epubMetadata,
writerTabStop = tabStop,
writerTableOfContents = toc &&
writerName' /= "s5",