Created
September 23, 2025 16:09
-
-
Save fauxsaurus/16503b718a76c91138afd1437e84f5f6 to your computer and use it in GitHub Desktop.
A short shell script to build an epub file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cd ./src/epub | |
| # remove old file (if it exists) | |
| rm -f ../../build/ebook.epub | |
| # create an uncompressed file with no metadata as the first entry | |
| zip -0X ../../build/ebook.epub mimetype | |
| # recursively compress all files in directory (while omitting the mimetype file) | |
| zip -rX -u ../../build/ebook.epub ./ -x "mimetype" | |
| # validate epub | |
| # download: epubCheck: https://www.w3.org/publishing/epubcheck/ unzip to scripts/epubcheck-5.2.1 | |
| # install: snap install openjdk, restart terminal | |
| openjdk.java -jar ../../scripts/epubcheck-5.2.1/epubcheck.jar ../../build/ebook.epub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment