@@ -153,6 +153,7 @@ data Opt = Opt
153 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
153 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
154 , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
154 , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
155 , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet
155 , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet
156+ , optEPUBMetadata :: String -- ^ EPUB metadata
156 , optDumpArgs :: Bool -- ^ Output command-line arguments
157 , optDumpArgs :: Bool -- ^ Output command-line arguments
157 , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
158 , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
158 , optStrict :: Bool -- ^ Use strict markdown syntax
159 , optStrict :: Bool -- ^ Use strict markdown syntax
@@ -192,6 +193,7 @@ defaultOpts = Opt
192 , optHTMLMathMethod = PlainMath
193 , optHTMLMathMethod = PlainMath
193 , optReferenceODT = Nothing
194 , optReferenceODT = Nothing
194 , optEPUBStylesheet = Nothing
195 , optEPUBStylesheet = Nothing
196+ , optEPUBMetadata = ""
195 , optDumpArgs = False
197 , optDumpArgs = False
196 , optIgnoreArgs = False
198 , optIgnoreArgs = False
197 , optStrict = False
199 , optStrict = False
@@ -470,6 +472,14 @@ options =
470 "FILENAME")
472 "FILENAME")
471 "" -- "Path of epub.css"
473 "" -- "Path of epub.css"
475+ , Option "" ["epub-metadata"]
478+ text <- UTF8.readFile arg
479+ return opt { optEPUBMetadata = text })
481+ "" -- "Path of epub metadata file"
473 , Option "D" ["print-default-template"]
483 , Option "D" ["print-default-template"]
475 (\arg _ -> do
485 (\arg _ -> do
@@ -631,6 +641,7 @@ main = do
631 , optHTMLMathMethod = mathMethod
641 , optHTMLMathMethod = mathMethod
632 , optReferenceODT = referenceODT
642 , optReferenceODT = referenceODT
633 , optEPUBStylesheet = epubStylesheet
643 , optEPUBStylesheet = epubStylesheet
644+ , optEPUBMetadata = epubMetadata
634 , optDumpArgs = dumpArgs
645 , optDumpArgs = dumpArgs
635 , optIgnoreArgs = ignoreArgs
646 , optIgnoreArgs = ignoreArgs
636 , optStrict = strict
647 , optStrict = strict
@@ -751,6 +762,7 @@ main = do
751 then defaultTemplate
762 then defaultTemplate
752 else template,
763 else template,
753 writerVariables = variables'',
764 writerVariables = variables'',
765+ writerEPUBMetadata = epubMetadata,
754 writerTabStop = tabStop,
766 writerTabStop = tabStop,
755 writerTableOfContents = toc &&
767 writerTableOfContents = toc &&
756 writerName' /= "s5",
768 writerName' /= "s5",