-
Notifications
You must be signed in to change notification settings - Fork 0
Merge EPUB Resource Caption and Alternative Text with Resource Metadata
This monograph processing step can be completed by using the following project script:
bundle exec ruby script/update_fmsl [-map] [-nofmsl] monograph_dir [monograph_dir...]
- monograph_dir
- Name of the monograph directory found on the publisher share drive.
- -map
- Forced generation of the monograph resource map. Otherwise, if a map exists, it will be used.
- -nofmsl
- Do not update the monograph FMSL file.
The script will perform the following:
Locate the monograph resource metadata file (METADATA_CSV=<monograph_dir>/resources/<ebook_isbn>_<author>.csv).
Locate the monograph EPUB file (EPUB_FILE=<monograph_dir>/<ebook_isbn>_<author>.epub).
-
Scan EPUB_FILE and determine a mapping from each resource reference to a resource file. This information is saved in the file RESOURCE_MAP=<monograph_dir>/resource_processing/resource_map.xml.
NOTE: Currently, a CSV version of RESOURCE_MAP is saved as well, but this file is deprecated.
Scan EPUB_FILE and extract the resource caption and alternative text. Load the METADATA_CSV and for each resource, merge the caption and alternative text. Save the modified resource metadata in the file NEW_METADATA_CSV=<monograph_dir>/resource_processing/<ebook_isbn>_<author>.csv.
After successful completion of the script, perform the following manual steps:
Copy METADATA_CSV to the <monograph_dir>/Archive directory.
Replace METADATA_CSV with NEW_METADATA_CSV within the <monograph_dir>/resources directory.