thegetty / mummyportraits

“Mummy Portraits of Roman Egypt: Emerging Research from the APPEAR Project,” edited by Marie Svoboda and Caroline R. Cartwright
https://www.getty.edu/publications/mummyportraits/
0 stars 0 forks source link

Manual overrides needed for EPUB generation #40

Open geealbers opened 4 years ago

geealbers commented 4 years ago

See related issue with Ambers catalogue.

There are several issues in the EPUB file for this publication as it is output with quire epub. The following are manual fixes that need to be made to the output.epub file every time it is regenerated.

Tables

This publication includes two tables that use the rowspan and colspan attributes, which Pandoc strips out. They are tables 7.2 and 17.1. The versions that are included by Pandoc in the EPUB file, in output/EPUB/text/ch014.xhtml and output/EPUB/text/ch025.xhtml respectively, need to be replaced with the originals in static/img/tables/ by copy and pasting.

(Note that there were two other tables that we particularly complicated and invalid in EPUB (6.1 and 6.2) and instead of leaving them as HTML tables in the EPUB, they are automatically replaced with static PNG versions which were manually created and added via an override to the q-figure.html shortcode. These don't require further manual work when re-outputting the EPUB files, just making a note of it here.)

IDs

Due to the ways both Hugo and Pandoc handle special characters in names, and as this publication links the names of the contirbutors to their biographies on the Contributor pages, there are a number of anchor links that need to be fixed for the EPUB. These regex find and replace pairings can be performed globally on the EPUB/text folder to take care of them all:

(#árpád-m-nagy-contributors|#renée-stein-contributors|#lin-rosa-spaabæk-contributors)
ch030.xhtml$1

-rp-d-m-nagy-contributors
árpád-m-nagy-contributors

ren-e-stein-contributors
renée-stein-contributors

lin-rosa-spaab-k-contributors
lin-rosa-spaabæk-contributors

Similarly, an anchor link to a figure is also nor resolving properly, and again this find and replace pattern will take care of it:

(#fig_6_9_a)
ch013.xhtml##fig-6-9-a

MOBI Output

Because of the above changes, the MOBI file then needs be output manually from the modified EPUB files. You can't use quire mobi.