diff options
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r-- | src/pandoc.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs index 27e4579aa..38ce27502 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -107,6 +107,7 @@ data Opt = Opt , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet + , optEPUBCoverImage :: Maybe FilePath -- ^ Path of epub cover image , optEPUBMetadata :: String -- ^ EPUB metadata , optDumpArgs :: Bool -- ^ Output command-line arguments , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments @@ -151,6 +152,7 @@ defaultOpts = Opt , optHTMLMathMethod = PlainMath , optReferenceODT = Nothing , optEPUBStylesheet = Nothing + , optEPUBCoverImage = Nothing , optEPUBMetadata = "" , optDumpArgs = False , optIgnoreArgs = False @@ -490,6 +492,13 @@ options = "FILENAME") "" -- "Path of epub.css" + , Option "" ["epub-cover-image"] + (ReqArg + (\arg opt -> + return opt { optEPUBCoverImage = Just arg }) + "FILENAME") + "" -- "Path of epub cover image" + , Option "" ["epub-metadata"] (ReqArg (\arg opt -> do @@ -674,6 +683,7 @@ main = do , optHTMLMathMethod = mathMethod , optReferenceODT = referenceODT , optEPUBStylesheet = epubStylesheet + , optEPUBCoverImage = epubCoverImage , optEPUBMetadata = epubMetadata , optDumpArgs = dumpArgs , optIgnoreArgs = ignoreArgs @@ -858,7 +868,7 @@ main = do case lookup writerName' writers of Nothing | writerName' == "epub" -> - writeEPUB epubStylesheet writerOptions doc2 + writeEPUB epubCoverImage epubStylesheet writerOptions doc2 >>= B.writeFile (encodeString outputFile) Nothing | writerName' == "odt" -> writeODT referenceODT writerOptions doc2 |