Skip to content

Commit

Permalink
initial all-in-one eBook of the Rigel Black Chronicles
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrawnCA committed May 24, 2022
0 parents commit 32c5546
Show file tree
Hide file tree
Showing 84 changed files with 41,497 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
123 changes: 123 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/bin/sh

DIR=`dirname $0`
INPUT_DIR="$DIR/src"
OUTPUT_DIR="$DIR/target"
MINIFIED_DIR="$OUTPUT_DIR/minified"
ARTIFACT_NAME="The Rigel Black Chronicles"
EPUB_ARTIFACT="$OUTPUT_DIR/$ARTIFACT_NAME.epub"

clean () {
rm -r "$OUTPUT_DIR"
mkdir "$OUTPUT_DIR"
}

minify_resources () {
echo "Minifying resources..."
mkdir -p "$MINIFIED_DIR"
cp -r "$INPUT_DIR/." "$MINIFIED_DIR/"
for file in `find $INPUT_DIR | grep -E '\.(xhtml|css|ncx|opf|xml)$'`; do
# collapse whitespace for efficiency
sed 's|\s\s\s*| |g' "$file" | tr -d '\n' > `echo $file | sed "s|$INPUT_DIR/|$MINIFIED_DIR/|"`
done
}

make_epub () {
echo "Generating ePub..."
SRC_DIR="$1"
if [ $# -lt 2 ]; then
DEST_FILE="$EPUB_ARTIFACT"
else
DEST_FILE="$2"
fi
# we need to force a non-relative path here
CANONICAL_DEST_FILE="$(cd "$(dirname "$DEST_FILE")"; pwd)/$(basename "$DEST_FILE")"
(cd $SRC_DIR && zip -q -X0 "$CANONICAL_DEST_FILE" mimetype && zip -q -r "$CANONICAL_DEST_FILE" META-INF OEBPS)
}

make_epub_if_needed () {
if [ ! -e "$EPUB_ARTIFACT" ]; then
make_epub "$INPUT_DIR" "$EPUB_ARTIFACT"
fi
}

check_epub () {
if (which epubcheck 2>/dev/null); then
epubcheck "$OUTPUT_DIR/$ARTIFACT" || return 1
fi
}

to_mobi () {
if (which ebook-convert >/dev/null 2>&1); then
echo "Converting to MOBI using Calibre ebook-convert..."
ebook-convert "$EPUB_ARTIFACT" "$OUTPUT_DIR/$ARTIFACT_NAME.mobi" --output-profile kindle_pw3 > /dev/null
else
echo "No MOBI converter found. Consider installing Calibre."
return 1
fi
}

to_pdf () {
if (which ebook-convert >/dev/null 2>&1); then
echo "Converting to PDF using Calibre ebook-convert..."
# try to use a Garamond font, otherwise just a Serif font
SERIF_FONT=$(fc-list : family |grep "Garamond" |cut -d , -f 1 |head -1)
if [ -z "$SERIF_FONT" ]; then
SERIF_FONT=Serif
fi
ebook-convert "$EPUB_ARTIFACT" "$OUTPUT_DIR/$ARTIFACT_NAME.pdf" --paper-size a4 --pdf-page-numbers --pdf-serif-family "$SERIF_FONT" --pdf-standard-font serif > /dev/null
elif (which mutool >/dev/null 2>&1); then
echo "Converting to PDF using Mutool..."
mutool convert -o "$OUTPUT_DIR/$ARTIFACT_NAME.pdf" "$EPUB_ARTIFACT" > /dev/null
else
echo "No PDF converter found. Consider installing Calibre or MuPDF Tools."
return 1
fi
}

make_target () {
BUILD_TARGET=$1
case $BUILD_TARGET in
all)
clean
minify_resources
make_epub "$MINIFIED_DIR"
to_mobi
to_pdf
;;
mobi)
make_epub_if_needed
to_mobi
;;
pdf)
make_epub_if_needed
to_pdf
;;
epub)
minify_resources
make_epub "$MINIFIED_DIR"
;;
uncompressed_epub)
make_epub "$INPUT_DIR" "$EPUB_ARTIFACT"
;;
check)
make_epub_if_needed
check_epub || exit 1
;;
clean)
clean
;;
*)
echo "Unrecognised build target: $BUILD_TARGET"
esac
echo "Done"
}

mkdir -p "$OUTPUT_DIR"
if [ $# -eq 0 ]; then
make_target all
else
for target in $@; do
make_target "$target"
done
fi
6 changes: 6 additions & 0 deletions src/META-INF/container.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="OEBPS/book.opf" media-type="application/oebps-package+xml" />
</rootfiles>
</container>
287 changes: 287 additions & 0 deletions src/OEBPS/AA1.xhtml

Large diffs are not rendered by default.

1,036 changes: 1,036 additions & 0 deletions src/OEBPS/AA10.xhtml

Large diffs are not rendered by default.

755 changes: 755 additions & 0 deletions src/OEBPS/AA11.xhtml

Large diffs are not rendered by default.

957 changes: 957 additions & 0 deletions src/OEBPS/AA12.xhtml

Large diffs are not rendered by default.

508 changes: 508 additions & 0 deletions src/OEBPS/AA13.xhtml

Large diffs are not rendered by default.

702 changes: 702 additions & 0 deletions src/OEBPS/AA14.xhtml

Large diffs are not rendered by default.

830 changes: 830 additions & 0 deletions src/OEBPS/AA15.xhtml

Large diffs are not rendered by default.

385 changes: 385 additions & 0 deletions src/OEBPS/AA2.xhtml

Large diffs are not rendered by default.

517 changes: 517 additions & 0 deletions src/OEBPS/AA3.xhtml

Large diffs are not rendered by default.

865 changes: 865 additions & 0 deletions src/OEBPS/AA4.xhtml

Large diffs are not rendered by default.

946 changes: 946 additions & 0 deletions src/OEBPS/AA5.xhtml

Large diffs are not rendered by default.

1,151 changes: 1,151 additions & 0 deletions src/OEBPS/AA6.xhtml

Large diffs are not rendered by default.

523 changes: 523 additions & 0 deletions src/OEBPS/AA7.xhtml

Large diffs are not rendered by default.

801 changes: 801 additions & 0 deletions src/OEBPS/AA8.xhtml

Large diffs are not rendered by default.

682 changes: 682 additions & 0 deletions src/OEBPS/AA9.xhtml

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions src/OEBPS/AAE.xhtml

Large diffs are not rendered by default.

531 changes: 531 additions & 0 deletions src/OEBPS/FF1.xhtml

Large diffs are not rendered by default.

1,140 changes: 1,140 additions & 0 deletions src/OEBPS/FF10.xhtml

Large diffs are not rendered by default.

784 changes: 784 additions & 0 deletions src/OEBPS/FF11.xhtml

Large diffs are not rendered by default.

843 changes: 843 additions & 0 deletions src/OEBPS/FF12.xhtml

Large diffs are not rendered by default.

1,369 changes: 1,369 additions & 0 deletions src/OEBPS/FF13.xhtml

Large diffs are not rendered by default.

1,027 changes: 1,027 additions & 0 deletions src/OEBPS/FF14.xhtml

Large diffs are not rendered by default.

748 changes: 748 additions & 0 deletions src/OEBPS/FF2.xhtml

Large diffs are not rendered by default.

1,081 changes: 1,081 additions & 0 deletions src/OEBPS/FF3.xhtml

Large diffs are not rendered by default.

988 changes: 988 additions & 0 deletions src/OEBPS/FF4.xhtml

Large diffs are not rendered by default.

771 changes: 771 additions & 0 deletions src/OEBPS/FF5.xhtml

Large diffs are not rendered by default.

700 changes: 700 additions & 0 deletions src/OEBPS/FF6.xhtml

Large diffs are not rendered by default.

968 changes: 968 additions & 0 deletions src/OEBPS/FF7.xhtml

Large diffs are not rendered by default.

1,299 changes: 1,299 additions & 0 deletions src/OEBPS/FF8.xhtml

Large diffs are not rendered by default.

941 changes: 941 additions & 0 deletions src/OEBPS/FF9.xhtml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/OEBPS/FFE.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Futile Facade</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h2>Epilogue</h2>
<div class="storytext">
<div class="storyparagraph">
<p>The rain that dashed itself against the windows didn't stir him. The wind howling at the shutters couldn't move him. He was calm. Focused. He had to be, or the Divination was all but useless.</p>
<p>Severus bent low over a large map, intention in every fiber as he drew his magic through the array with ruthless control. At the center of the runes, a cluster of fluorescent green spheres glowed softly, perfectly imbued far beyond the natural life of such things. Retaining the magical signature of the one who imbued them years before.</p>
<p>The crystal beneath his right hand grew scalding as it absorbed the magic in the array. At the last possible moment, when it was so hot he risked third-degree burns across his palm, he released it. The crystal lurched into the air and hung suspended over the map in quivering uncertainty. Slowly, as he began to strain with the effort of keeping the array active, the crystal lilted, tilted, and slid sideways to hover unerringly over south-east England.</p>
<p>Severus released the magic with a gasp, vindicated. The boy hadn't left the country.</p>
<p>His scrying was not accurate enough to geolocate his wayward pupil, but he was nonetheless satisfied. Let the offended imbeciles scour the continent for him. Severus would find the teen in his own time. Straightening, he fixed his sights on the pristine apron in the corner. It hung limp, abandoned, with no evidence it had ever been worn at all.</p>
<p>A potioneer like Rigel couldn't hide his talents forever.</p>
</div>

<div class="storyparagraph">
<p>The boy had ruined everything. The legislation needed to save the magical world in tatters, votes evaporated in the boil of public outrage.</p>
<p>To add insult to injury, he'd managed to hamstring his right-hand man on the way out. Lucius and all his resources—useless.</p>
<p>Anger simmered into incredulity, and the dregs of that congealed to insatiable curiosity and he had to know. <em>How</em> could the boy have done this? And who <em>was</em> he?</p>
<p>His spies at the Ministry reported the boy was European: French, possibly. Speculation put him the bastard of an old line, and naturally so—his magic was too great to be otherwise explained.</p>
<p>Parseltongue was not a trait that ran in European lines, however. He should know. He had traced the line extensively, perhaps further than anyone else. If not a Black, he could only be the by-blow of another family intermingled with the Peverell brothers.</p>
<p>He would find the boy.</p>
<p>The door to his study creaked open, and Jacob Owens strode though it with a sour expression.</p>
<p>Speaking of long-lost Slytherin heirs…</p>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 32c5546

Please sign in to comment.