aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-11-30 15:25:28 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-11-30 15:25:28 -0800
commit17ef39d1577a7c844f8747294f0e7a0486c1edaa (patch)
tree04a7c7dc6bd89c3f3c9af90d689e0c4dafc7e484
parent96b678d823b544e3da7dd8531615c52de6164cb8 (diff)
downloadpandoc-17ef39d1577a7c844f8747294f0e7a0486c1edaa.tar.gz
Fixed `cover-image` in EPUB YAML metadata.
-rw-r--r--README4
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs3
2 files changed, 4 insertions, 3 deletions
diff --git a/README b/README
index 35194769b..2a5ecc6ad 100644
--- a/README
+++ b/README
@@ -542,7 +542,7 @@ Options affecting specific writers
`--epub-cover-image=`*FILE*
: Use the specified image as the EPUB cover. It is recommended
that the image be less than 1000px in width and height. Note that
- in a markdown source document you can also specify `epub-cover-image`
+ in a markdown source document you can also specify `cover-image`
in a YAML metadata block (see [EPUB Metadata], below).
`--epub-metadata=`*FILE*
@@ -2820,7 +2820,7 @@ The following fields are recognized:
~ A string value.
`rights`
~ A string value.
-`epub-cover-image`
+`cover-image`
~ A string value (path to cover image).
Literate Haskell support
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index a3b01848e..9745db5a0 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -279,7 +279,8 @@ metadataFromMeta opts meta = EPUBMetadata{
relation = metaValueToString <$> lookupMeta "relation" meta
coverage = metaValueToString <$> lookupMeta "coverage" meta
rights = metaValueToString <$> lookupMeta "rights" meta
- coverImage = lookup "epub-cover-image" (writerVariables opts)
+ coverImage = lookup "epub-cover-image" (writerVariables opts) `mplus`
+ (metaValueToString <$> lookupMeta "cover-image" meta)
-- | Produce an EPUB file from a Pandoc document.
writeEPUB :: WriterOptions -- ^ Writer options