4 ms·
Skip the images. Below is a quick and dirty script I use to make a single HTML file from an EPUB file. It outputs a _script_ that when run will output the HTML
by 1vuio0pswjnm7 3y ago
Skip the images.
Below is a quick and dirty script I use to make a single HTML file from an EPUB file. It outputs a _script_ that when run will output the HTML files in the EPUB as a single file to stdout. It is not perfect, e.g., sometimes the order of the HTML files may need to be adjusted, but I rarely bother. I open the HTML file in links and optionally save as .txt. I don't care for UTF-8 or other non-ASCII characters.
EPUB to single HTML file.
#!/bin/sh
test ${#1} -ge 1||exec echo usage: $0 1.epub;
printf "(\n"
for x in ${1-*.epub};do
echo printf \'\\n\\n,,,,,,,,,,,,,,,,,,,,, "$x" ,,,,,,,,,,,,,,,,,,,,,,,\\n\\n\'
7z l $x|sed -n "s/.* /7z x -so $x /;/nav.xhtml/d;/[tx]ml$/p"|sort -n
done
echo ")|tr -cd '[\\\12\40-\176]'"
- marttt 3y agoYeah, I had a similar script of my own, utilizing the fact that EPUBs are essentially zip files. Thanks for sharing yours. I'm a great fan of your scripts for text-only browsing etc.