Fixed cover-image in EPUB YAML metadata.

This commit is contained in:
John MacFarlane 2013-11-30 15:25:28 -08:00
parent 96b678d823
commit 17ef39d157
2 changed files with 4 additions and 3 deletions

4
README
View file

@ -542,7 +542,7 @@ Options affecting specific writers
`--epub-cover-image=`*FILE* `--epub-cover-image=`*FILE*
: Use the specified image as the EPUB cover. It is recommended : Use the specified image as the EPUB cover. It is recommended
that the image be less than 1000px in width and height. Note that 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). in a YAML metadata block (see [EPUB Metadata], below).
`--epub-metadata=`*FILE* `--epub-metadata=`*FILE*
@ -2820,7 +2820,7 @@ The following fields are recognized:
~ A string value. ~ A string value.
`rights` `rights`
~ A string value. ~ A string value.
`epub-cover-image` `cover-image`
~ A string value (path to cover image). ~ A string value (path to cover image).
Literate Haskell support Literate Haskell support

View file

@ -279,7 +279,8 @@ metadataFromMeta opts meta = EPUBMetadata{
relation = metaValueToString <$> lookupMeta "relation" meta relation = metaValueToString <$> lookupMeta "relation" meta
coverage = metaValueToString <$> lookupMeta "coverage" meta coverage = metaValueToString <$> lookupMeta "coverage" meta
rights = metaValueToString <$> lookupMeta "rights" 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. -- | Produce an EPUB file from a Pandoc document.
writeEPUB :: WriterOptions -- ^ Writer options writeEPUB :: WriterOptions -- ^ Writer options