Created
August 5, 2016 04:42
-
-
Save mhulse/4f3fe401c76c2ec2a79382279c7c42bd to your computer and use it in GitHub Desktop.
Bash script to convert .epub (x)HTML into .icml files; used to get ebooks into Indesign. http://indesignsecrets.com/ebook-production-backwards-from-epub-to-indesign.php
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
#!/usr/bin/env bash | |
function init() { | |
dlxsl && transform | |
} | |
function dlxsl() { | |
curl -O -J "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ickmull/tkbr2icml-v044.xsl" --silent | |
} | |
function transform() { | |
for filename in *.html; do | |
for ((i=0; i<=3; i++)); do | |
base=${filename%.html} | |
xsltproc --output "$base.icml" --novalid "tkbr2icml-v044.xsl" $filename | |
done | |
done | |
} | |
# Start program: | |
init |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment