first commit
This commit is contained in:
commit
81099ce7a4
5 changed files with 95 additions and 0 deletions
14
init
Executable file
14
init
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
curl -sO https://spqrz.gitlab.io/M3GAN-files.epub
|
||||
unzip -qo M3GAN-files.epub
|
||||
FilesInOrder=$(grep '<content src' toc.ncx | sed 's/[^"]*"//;s/[#"].*//'|uniq)
|
||||
# Do not assume the EPUB file boundaries are sensible stopping points;
|
||||
# cat them together and re-determine the stopping points.
|
||||
cat $FilesInOrder | tr $'\n' ' ' | sed 's/<\([^ >]*\) [^>]*>/<\1>/g;s,</*[^hpeb/][^>]*>,,g;s,<html>[^<]*<head>[^<]*</head>[^<]*<body>,,g;s,</body></html>,,g;s,is legible.</p>,is legible.</p><h3>Rest of chapter (split to fit the 30k limit)</h3>,;s,<em>Aftermath: Cole:</em>,<h4>Aftermath: Cole:</h4>,;s/<h/\n&/g;s/\([12]\)>\n<h/\1><h/g;s/^ *\n//' > one-section-per-line.txt
|
||||
# Clean up
|
||||
rm -rf epub* co* META* *.css *.ncx titlepage* mimetype
|
||||
echo 1 > bookmark.txt
|
||||
# Print instructions
|
||||
echo "Book initialised. To start reading, run $(dirname "$0")/read"
|
||||
Loading…
Add table
Add a link
Reference in a new issue