diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-11-30 15:25:28 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-11-30 15:25:28 -0800 |
commit | 17ef39d1577a7c844f8747294f0e7a0486c1edaa (patch) | |
tree | 04a7c7dc6bd89c3f3c9af90d689e0c4dafc7e484 | |
parent | 96b678d823b544e3da7dd8531615c52de6164cb8 (diff) | |
download | pandoc-17ef39d1577a7c844f8747294f0e7a0486c1edaa.tar.gz |
Fixed `cover-image` in EPUB YAML metadata.
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 3 |
2 files changed, 4 insertions, 3 deletions
@@ -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 |