diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-07-13 15:20:14 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-07-13 15:20:14 -0700 |
commit | 5f495eaace3ce4cf15a89b6b3cfb54df6d1658d8 (patch) | |
tree | 596e8f154d4be90a363fa42f0398e7c1bb5ce77f /data | |
parent | 6cf5c3f6ac267c93fe7557add482307d494a8c75 (diff) | |
download | pandoc-5f495eaace3ce4cf15a89b6b3cfb54df6d1658d8.tar.gz |
EPUB writer: Use svg tag wrapper for cover image.
In addition, the code generating the image has been moved
to the template, to make it more customizable.
Those who use custom EPUB templates will need to adjust their
templates, adding the code to generate the cover image.
(Previously this was just inserted into 'body'.)
Closes #5643.
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/default.epub2 | 8 | ||||
-rw-r--r-- | data/templates/default.epub3 | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/data/templates/default.epub2 b/data/templates/default.epub2 index afcf96a3e..f440134df 100644 --- a/data/templates/default.epub2 +++ b/data/templates/default.epub2 @@ -46,6 +46,13 @@ $if(rights)$ <div class="rights">$rights$</div> $endif$ $else$ +$if(coverpage)$ +<div id="cover-image"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 $cover-image-width$ $cover-image-height$" preserveAspectRatio="none"> +<image width="$cover-image-width$" height="$cover-image-height$" xlink:href="../media/$cover-image$" /> +</svg> +</div> +$else$ $for(include-before)$ $include-before$ $endfor$ @@ -54,6 +61,7 @@ $for(include-after)$ $include-after$ $endfor$ $endif$ +$endif$ </body> </html> diff --git a/data/templates/default.epub3 b/data/templates/default.epub3 index f0feb147a..4f5bd6641 100644 --- a/data/templates/default.epub3 +++ b/data/templates/default.epub3 @@ -47,6 +47,13 @@ $if(rights)$ $endif$ </section> $else$ +$if(coverpage)$ +<div id="cover-image"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 $cover-image-width$ $cover-image-height$" preserveAspectRatio="none"> +<image width="$cover-image-width$" height="$cover-image-height$" xlink:href="../media/$cover-image$" /> +</svg> +</div> +$else$ $for(include-before)$ $include-before$ $endfor$ @@ -55,6 +62,7 @@ $for(include-after)$ $include-after$ $endfor$ $endif$ +$endif$ </body> </html> |