-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
| Requirement | Notes |
|---|---|
| Docker | The conversion runs in a container. The daemon must be running, and your user should be in the docker group — otherwise run the script with sudo. |
perl |
Used for filename cleanup. Standard on most Linux systems. |
timeout |
Used when present, to cap runaway conversions. Part of coreutils. |
Everything else the script uses (find, sed, basename, mv, cp) is standard on any Linux system.
-
Put
epubify.shsomewhere on your system and make it executable:chmod +x epubify.sh
-
Edit the variables at the top of the script — at minimum
INPUT_DIR,STAGING_DIRandOUTPUT_DIR. See Configuration. -
Create your input folder.
INPUT_DIRmust already exist — the script checks it and stops if it doesn't. Staging, output and the model cache are all created for you.
Two large one-off downloads happen the first time:
-
The container image.
ghcr.io/overcuriousity/pdf2epub:latestis pulled automatically if it isn't already present locally. If the pull fails, setBUILD_CONTEXTto a clone of the pdf2epub repository and the script builds the image itself instead of giving up. -
The models. pdf2epub downloads its layout and OCR models on first conversion. They're kept in
MODEL_CACHEand reused afterwards.
MODEL_CACHE is a bind mount rather than a named Docker volume on purpose: the container runs as your UID, and an empty named volume is created root-owned, which the container user then couldn't write to.
The published image ships a CPU PyTorch build, so a CUDA card sits idle no matter what — there's deliberately no --gpus flag in the script. For GPU acceleration, install pdf2epub natively with a CUDA PyTorch build instead of using this script.