A collection of bash scripts (developed on Mac) that can help in the making of perfect crafted EPUBs.
- install pup: https://github.com/ericchiang/pup
- download the scripts:
git clone https://github.com/gregoriopellegrino/epub-bash-scripts
This script replace the <title>
value of each HTML document in the EPUB with the first occurance of the most important heading in it.
/path_to/assignTitles.sh /path_to/OEBPS
This script assigns ARIA role
attribute to all HTML elements that have an epub:type
attribute (as role
is missing).
The mapping is based on https://idpf.github.io/epub-guides/aria-mapping/
/path_to/mapEpubTypeToRole.sh /path_to/OEBPS
This script converts px
values (in CSS) to em
.
/path_to/mapEpubTypeToRole.sh /path_to/OEBPS
- Some of the scripts use regex for HTML manipulation: please note that HTML should not be regexed! The end is nigh.
- Pixels should not be transformed in em: pixels are an absolute unit of measures, ems depends on the parent element (https://stackoverflow.com/a/4575518)
- Use these script at your own risk!
MIT License https://github.com/gregoriopellegrino/epub-bash-scripts/blob/master/LICENSE