@@ -153,6 +153,7 @@ data Opt = Opt
153153 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
154154 , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
155155 , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet
156+ , optEPUBMetadata :: String -- ^ EPUB metadata
156157 , optDumpArgs :: Bool -- ^ Output command-line arguments
157158 , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
158159 , optStrict :: Bool -- ^ Use strict markdown syntax
@@ -192,6 +193,7 @@ defaultOpts = Opt
192193 , optHTMLMathMethod = PlainMath
193194 , optReferenceODT = Nothing
194195 , optEPUBStylesheet = Nothing
196+ , optEPUBMetadata = ""
195197 , optDumpArgs = False
196198 , optIgnoreArgs = False
197199 , optStrict = False
@@ -470,6 +472,14 @@ options =
470472 "FILENAME")
471473 "" -- "Path of epub.css"
472474
475+ , Option "" ["epub-metadata"]
476+ (ReqArg
477+ (\arg opt -> do
478+ text <- UTF8.readFile arg
479+ return opt { optEPUBMetadata = text })
480+ "FILENAME")
481+ "" -- "Path of epub metadata file"
482+
473483 , Option "D" ["print-default-template"]
474484 (ReqArg
475485 (\arg _ -> do
@@ -631,6 +641,7 @@ main = do
631641 , optHTMLMathMethod = mathMethod
632642 , optReferenceODT = referenceODT
633643 , optEPUBStylesheet = epubStylesheet
644+ , optEPUBMetadata = epubMetadata
634645 , optDumpArgs = dumpArgs
635646 , optIgnoreArgs = ignoreArgs
636647 , optStrict = strict
@@ -751,6 +762,7 @@ main = do
751762 then defaultTemplate
752763 else template,
753764 writerVariables = variables'',
765+ writerEPUBMetadata = epubMetadata,
754766 writerTabStop = tabStop,
755767 writerTableOfContents = toc &&
756768 writerName' /= "s5",