Producing an Ebook, Step by Step
This guide is meant to take you step-by-step through the creation of a complete Standard Ebook. While it might seem a little long, most of the text is a description of how to use various automated scripts. It can take just an hour or two for an experienced producer to produce a draft ebook for proofreading (depending on the complexity of the ebook, of course).
-
-
Download and set up the Standard Ebooks production tools
-The Standard Ebooks project has a series of tools that will help you produce an ebook. You can download them at Github:
cd ~/ git clone https://github.com/standardebooks/tools.git
-Check the
-README.md
file for instructions on how to install the few dependencies the tools require.We’ll assume you’ve installed the SE tools to
+~/tools/
.Download and set up the Standard Ebooks production toolset
+The Standard Ebooks project has a toolset that will help you produce an ebook. Read how to install them here.
+Make sure you take a moment to put the
+se
executable that’s installed with the toolset on your shell’s$PATH
. How to do that varies depending on what shell you’re using.
+ -
+
Make sure the toolset is up-to-date
+The toolset changes frequently. If this isn’t your first ebook production, always make sure to update the toolset before you start a new ebook, so that you’re working with the latest version of the tools.
+pip3 install --upgrade standardebooks
-
Select an ebook to produce
@@ -62,17 +66,17 @@ require_once('Core.php'); -
Create a Standard Ebooks epub skeleton
An epub file is just a bunch of files arranged in a particular folder structure, then all zipped up. That means editing an epub file is as easy as editing a bunch of text files within a certain folder structure, then creating a zip file out of that folder.
-You can’t just arrange files willy-nilly, though—the epub standard expects certain files in certain places. So once you’ve picked a book to produce, create the basic epub skeleton in a working directory. The
+create-draft
tool will create a basic Standard Ebooks epub folder structure, initialize agit
repository within it, and prefill a few fields incontent.opf
(the file that contains the ebook’s metadata).You can’t just arrange files willy-nilly, though—the epub standard expects certain files in certain places. So once you’ve picked a book to produce, create the basic epub skeleton in a working directory.
se create-draft
will create a basic Standard Ebooks epub folder structure, initialize agit
repository within it, and prefill a few fields incontent.opf
(the file that contains the ebook’s metadata).-
With the
---gutenberg-ebook-url
optionYou can pass the
create-draft
tool the URL for the Project Gutenberg ebook, and the tool will try to download the ebook into./src/epub/text/body.xhtml
and prefill a lot of metadata for you:~/tools/create-draft --author="Robert Louis Stevenson" --title="The Strange Case of Dr. Jekyll and Mr. Hyde" --gutenberg-ebook-url="https://www.gutenberg.org/ebooks/43" cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/
-Because Project Gutenberg ebooks are produced in different ways by different people,
+create-draft
has to make some guesses and it might guess wrong. Make sure to carefully review the data it prefills into./src/epub/text/body.xhtml
,./src/epub/text/colophon.xhtml
, and./src/epub/content.opf
.You can pass
se create-draft
the URL for the Project Gutenberg ebook, and it’ll try to download the ebook into./src/epub/text/body.xhtml
and prefill a lot of metadata for you:se create-draft --author="Robert Louis Stevenson" --title="The Strange Case of Dr. Jekyll and Mr. Hyde" --gutenberg-ebook-url="https://www.gutenberg.org/ebooks/43" cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/
+Because Project Gutenberg ebooks are produced in different ways by different people,
se create-draft
has to make some guesses and it might guess wrong. Make sure to carefully review the data it prefills into./src/epub/text/body.xhtml
,./src/epub/text/colophon.xhtml
, and./src/epub/content.opf
.In particular, make sure that the Project Gutenberg license is stripped from
./src/epub/text/body.xhtml
, and that the original transcribers in./src/epub/text/colophon.xhtml
and./src/epub/content.opf
are presented correctly. -
Without the
---gutenberg-ebook-url
optionIf you prefer to do things by hand, that’s an option too.
~/tools/create-draft --author="Robert Louis Stevenson" --title="The Strange Case of Dr. Jekyll and Mr. Hyde" cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/
+If you prefer to do things by hand, that’s an option too.
se create-draft --author="Robert Louis Stevenson" --title="The Strange Case of Dr. Jekyll and Mr. Hyde" cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/
Now that we have the skeleton up, we’ll download Gutenberg’s HTML file for Jekyll directly into
text/
folder and name itbody.xhtml
.wget -O src/epub/text/body.xhtml https://www.gutenberg.org/files/43/43-h/43-h.htm
Many Gutenberg books were produced before UTF-8 became a standard, so we may have to convert to UTF-8 before we start work. First, check the encoding of the file we just downloaded. (Mac OS users, try
file -I
.)file -bi src/epub/text/body.xhtml
The output is
@@ -97,7 +101,7 @@ require_once('Core.php');text/html; charset=iso-8859-1
. That’s the wrong encoding!This edition of Jekyll includes a table of contents; remove that too. Standard Ebooks uses the ToC generated by the ereader, and doesn’t include one in the readable text.
-
-
Remove any footer text and markup after the public domain text ends. This includes the Gutenberg license—but don’t worry, we’ll credit Gutenberg in the colophon and metadata later. If you used the
+--gutenberg-ebook-url
option with thecreate-draft
tool, then it may have already stripped the license for you, and included some Gutenberg metadata already.Remove any footer text and markup after the public domain text ends. This includes the Gutenberg license—but don’t worry, we’ll credit Gutenberg in the colophon and metadata later. If you invoked
se create-draft
with the--gutenberg-ebook-url
option, then it may have already stripped the license for you and included some Gutenberg metadata.
Now our source file looks something like this:
@@ -110,19 +114,19 @@ require_once('Core.php');Split the source text at logical divisions
The file we downloaded contains the entire work. Jekyll is a short work, but for longer work it quickly becomes impractical to have the entire text in one file. Not only is it a pain to edit, but ereaders often have trouble with extremely large files.
The next step is to split the file at logical places; that usually means at each chapter break. For works that are contain their chapters in larger “parts,” the part division should also be its own file. For example, see Treasure Island.
-To split the work, we use the
+split-file
tool.split-file
takes a single file and breaks it in to a new file every time it encounters the markup<!--se:split-->
. The tool automatically includes basic header and footer markup in each split file.To split the work, we use
se split-file
.se split-file
takes a single file and breaks it in to a new file every time it encounters the markup<!--se:split-->
.se split-file
automatically includes basic header and footer markup in each split file.Notice that in our source file, each chapter is marked with an
h2
tag. We can use that to our advantage and save ourselves the trouble of adding the<!--se:split-->
markup by hand:perl -pi -e "s/<h2/<\!--se:split--><h2/g" src/epub/text/body.xhtml
(Note the slash before the ! for compatibility with some shells.)
-Now that we’ve added our markers, we split the file.
split-file
puts the results in our current directory and conveniently names them by chapter number.~/tools/split-file src/epub/text/body.xhtml mv chapter* src/epub/text/
+Now that we’ve added our markers, we split the file.
se split-file
puts the results in our current directory and conveniently names them by chapter number.se split-file src/epub/text/body.xhtml mv chapter* src/epub/text/
Once we’re happy that the source file has been split correctly, we can remove it.
rm src/epub/text/body.xhtml
-
-
Clean up the source text
If you open up any of the chapter files we now have in the
src/epub/text/
folder, you’ll notice that the code isn’t very clean. Paragraphs are split over multiple lines, indentation is all wrong, and so on.If you try opening a chapter in a web browser, you’ll also likely get an error if the chapter includes any HTML entities, like
-—
. This is because Gutenberg uses plain HTML, which allows entities, but epub uses XHTML, which doesn’t.We can fix all of this pretty quickly using the
clean
tool.clean
accepts as its argument the root of a Standard Ebook directory, and with the--single-lines
option it’ll remove the hard line wrapping that Gutenberg is fond of. We’re already in the root, so we pass it.
.~/tools/clean --single-lines .
+We can fix all of this pretty quickly using
se clean
.se clean
accepts as its argument the root of a Standard Ebook directory, and with the--single-lines
option it’ll remove the hard line wrapping that Gutenberg is fond of. We’re already in the root, so we pass it.
.se clean --single-lines .
Things look much better now, but we’re not perfect yet. If you open a chapter you’ll notice that the
<p>
and<h2>
tags have a space between the tag and the text. We can clean that up with a fewperl
commands.perl -pi -e "s/<(p|h2)>\s+/<\1>/g" src/epub/text/chapter* perl -pi -e "s/\s+<\/(p|h2)>/<\/\1>/g" src/epub/text/chapter*
-Finally, we have to do a quick runthrough of each file by hand to cut out any lingering Gutenberg markup that doesn’t belong. In Jekyll, notice that each chapter ends with some extra empty
+div
s andp
s. These were used by the original transcriber to put spaces between the chapters, and they’re not necessary anymore, so remove them before continuing.Finally, we have to do a quick runthrough of each file by hand to cut out any lingering Gutenberg markup that doesn’t belong. In Jekyll, notice that each chapter ends with some extra empty
<div>
s and<p>
s. These were used by the original transcriber to put spaces between the chapters, and they’re not necessary anymore, so remove them before continuing.Now our chapter 1 source looks like this:
<?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/, se: http://standardebooks.org/vocab/1.0" xml:lang="en-US"> @@ -145,9 +149,9 @@ require_once('Core.php');
-
Typogrify the source text and perform the second commit
-Now that we have a clean starting point, we can start getting the real work done. The
-typogrify
tool can do a lot of the heavy lifting necessary to bring an ebook up to Standard Ebooks typography standards.Like
clean
,typogrify
accepts as its argument the root of a Standard Ebook directory.~/tools/typogrify .
-Among other things,
+typogrify
does the following:Now that we have a clean starting point, we can start getting the real work done.
+se typogrify
can do a lot of the heavy lifting necessary to bring an ebook up to Standard Ebooks typography standards.Like
se clean
,se typogrify
accepts as its argument the root of a Standard Ebook directory.se typogrify .
+Among other things,
se typogrify
does the following:-
Converts straight quotes to curly quotes;
@@ -162,11 +166,11 @@ require_once('Core.php');Normalizes spacing in em-, en-, and double-em-dashes, as well as between nested quotation marks, and adds word joiners.
You can run
-typogrify
as many times as you want on a source directory; it should always produce the same result, regardless of what state the source directory was in when you ran it.While
-typogrify
does a lot of work for you, each ebook is totally different so there’s almost always more work to do that can only be done by hand. In Jekyll, you’ll notice that the chapter titles are in all caps. The SE standard requires chapter titles to be in title case, and thetitlecase
tool can do that for us.
+titlecase
accepts a string as its argument, and outputs the string in title case. Many text editors allow you to configure external macros—perfect for creating a keyboard shortcut to runtitlecase
on selected text.You can run
+se typogrify
as many times as you want on a source directory; it should always produce the same result, regardless of what state the source directory was in when you ran it.While
+se typogrify
does a lot of work for you, each ebook is totally different so there’s almost always more work to do that can only be done by hand. In Jekyll, you’ll notice that the chapter titles are in all caps. The SE standard requires chapter titles to be in title case, andse titlecase
can do that for us.se titlecase
accepts a string as its argument, and outputs the string in title case. Many text editors allow you to configure external macros—perfect for creating a keyboard shortcut to runse titlecase
on selected text.Typography checklist
-There are many things that
+typogrify
isn’t well suited to do automatically. Check our complete typography manual to see exactly how to format the work. Below is a brief, but incomplete, list of common issues that arise in ebooks:There are many things that
se typogrify
isn’t well suited to do automatically. Check our complete typography manual to see exactly how to format the work. Below is a brief, but incomplete, list of common issues that arise in ebooks:-
Typography rules for coordinates. Use the prime and double prime glyphs for coordinates. These regexes helps match and replace coordinates:
@@ -178,7 +182,7 @@ require_once('Core.php');|([0-9])+’|\1′|g
,|([0-9])+”|\1″|g
Typography rules for text in all caps. Text in all caps is almost never correct, and should either be converted to lowercase with the
<em>
tag (for spoken emphasis),<strong>
(for extreme spoken emphasis), or<b>
(for unsemantic small caps, like in storefront signs). This case-sensitive regex helps find candidates:(?<!en-)[A-Z]{2,}(?!")
-
-
Sometimes
+typogrify
doesn’t close quotation marks near em-dashes correctly. Try to find such instances with this regex:—[’”][^<\s]
Sometimes
se typogrify
doesn’t close quotation marks near em-dashes correctly. Try to find such instances with this regex:—[’”][^<\s]
- @@ -188,25 +192,26 @@ require_once('Core.php');
The second commit
-Once you’ve run
typogrify
and you’ve searched the work for the common issues above, you can perform your second commit.git add -A git commit -m "Typogrify"
+Once you’ve run
se typogrify
and you’ve searched the work for the common issues above, you can perform your second commit.git add -A git commit -m "Typogrify"
-
-
Convert footnotes to endnotes and add a list of illustrations
Works often include footnotes, either added by an annotator or as part of the work itself. Since ebooks don’t have a concept of a “page,” there’s no place for footnotes to go. Instead, we convert footnotes to a single endnotes file, which will provide popup references in the final epub.
The endnotes file and the format for endnote links are standardized in the semantics manual.
+If you find that you accidentally mis-ordered an endnote, never fear!
se reorder-endnotes
will allow you to quickly rearrange endnotes in your ebook.If a work has illustrations besides the cover and title pages, we include a “list of illustrations” at the end of the book, after the endnotes but before the colophon. The LoI file is also standardized in the semantics manual.
Jekyll doesn’t have any footnotes, endnotes, or illustrations, so we skip this step.
-
Converting British quotation to American quotation
If the work you’re producing uses British quotation style (single quotes for dialog versus double quotes in American), we have to convert it to American style. We use American style in part because it’s easier to programmatically convert from American to British than it is to convert the other way around. Skip this step if your work is already in American style.
-Standard Ebooks has a tool called
british2american
that helps with the conversion. Your work must already be typogrified (the previous step in this guide) for the script to work.~/tools/british2american .
-While
+british2american
tries its best, thanks to the quirkiness of English punctuation rules it’ll invariably mess some stuff up. Proofreading is required after running the conversion.se british2american
attempts to automate the conversion. Your work must already be typogrified (the previous step in this guide) for the script to work.se british2american .
+While
se british2american
tries its best, thanks to the quirkiness of English punctuation rules it’ll invariably mess some stuff up. Proofreading is required after running the conversion.After you’ve run the conversion, do another commit.
git add -A git commit -m "Convert from British-style quotation to American style"
-
Add semantics
-Part of the Standard Ebooks project is adding meaningful semantics wherever possible in the text. The
+semanticate
tool does a little of that for us—for example, for some common abbreviations—but much of it has to be done by hand.Part of the Standard Ebooks project is adding meaningful semantics wherever possible in the text.
se semanticate
does a little of that for us—for example, for some common abbreviations—but much of it has to be done by hand.Adding semantics means two things:
-
@@ -217,8 +222,8 @@ require_once('Core.php');
Currently we use a mix of epub3 structural semantics, z3998 structural semantics for when the epub3 vocabulary isn’t enough, and our own SE semantics for when z3998 isn’t enough.
Use the
semanticate
tool to do some common cases for you:~/tools/semanticate .
-semanticate
tries its best to correctly add semantics, but sometimes it’s wrong. For that reason you should review the changes it made before accepting them:git difftool
+Use
se semanticate
to do some common cases for you:se semanticate .
+se semanticate
tries its best to correctly add semantics, but sometimes it’s wrong. For that reason you should review the changes it made before accepting them:git difftool
Beyond that, adding semantics is mostly a by-hand process. See our semantics manual for a detailed list of the kinds of semantics we expect in a Standard Ebook.
Here’s a short list of some of the more common semantic issues you’ll encounter:
-
@@ -229,7 +234,7 @@ require_once('Core.php');
-
@@ -217,8 +222,8 @@ require_once('Core.php');
-
-
Semantics rules for abbreviations. Abbreviations should always be wrapped in the
+abbr
tag and with the correctclass
attribute.Semantics rules for abbreviations. Abbreviations should always be wrapped in the
<abbr>
tag and with the correctclass
attribute.Specifically, see the typography rules for initials. Wrap people’s initials in
<abbr class="name">
. This regex helps match initials:[A-Z]\.\s*([A-Z]\.\s*)+
- @@ -246,30 +251,30 @@ require_once('Core.php');
-
Modernize spelling and hyphenation
-Many older works use outdated spelling and hyphenation that would distract a modern reader. (For example, “to-night” instead of “tonight”).
-modernize-spelling
is a tool to automatically remove hyphens from words that used to be compounded, but aren’t anymore in modern English spelling.Do run this tool on prose. Don’t run this tool on poetry.
~/tools/modernize-spelling .
+Many older works use outdated spelling and hyphenation that would distract a modern reader. (For example, “to-night” instead of “tonight”).
+se modernize-spelling
automatically removes hyphens from words that used to be compounded, but aren’t anymore in modern English spelling.Do run this tool on prose. Don’t run this tool on poetry.
se modernize-spelling .
After you run the tool, you must check what the tool did to confirm that each removed hyphen is correct. Sometimes the tool will remove a hyphen that needs to be included for clarity, or one that changes the meaning of the word, or it may result in a word that just doesn’t seem right. Re-introducing a hyphen is OK in these cases.
-Here’s a real-world example of where
+modernize-spelling
made the wrong choice: In The Picture of Dorian Gray chapter 11, Oscar Wilde writes:Here’s a real-world example of where
se modernize-spelling
made the wrong choice: In The Picture of Dorian Gray chapter 11, Oscar Wilde writes:He possessed a gorgeous cope of crimson silk and gold-thread damask…
+modernize-spelling
would replace the dash ingold-thread
so that it readsgoldthread
. Wellgoldthread
is an actual word, which is why it’s in our dictionary, and why the script makes a replacement—but it’s the name of a type of flower, not a golden fabric thread! In this case,modernize-spelling
made an incorrect replacement, and we have to change it back.se modernize-spelling
would replace the dash ingold-thread
so that it readsgoldthread
. Wellgoldthread
is an actual word, which is why it’s in our dictionary, and why the script makes a replacement—but it’s the name of a type of flower, not a golden fabric thread! In this case,se modernize-spelling
made an incorrect replacement, and we have to change it back.git
provides a handy way for us to visualize these differences:git difftool
After you’ve reviewed the changes that the tool made, do another commit. This commit is important, because it gives purists an avenue to revert modernizing changes to the original text.
-Note how we preface this commit with "[Editorial]". Any change you make to the source text that can be considered a modernization or editorial change should be prefaced like this, so that the
git
history can be easily searched by people looking to revert changes.git add -A git commit -m "[Editorial] Modernize hyphenation and spelling"
+Note how we preface this commit with “[Editorial]”. Any change you make to the source text that can be considered a modernization or editorial change should be prefaced like this, so that the
git
history can be easily searched by people looking to revert changes.git add -A git commit -m "[Editorial] Modernize hyphenation and spelling"
-
Modernize spacing in select words
Over time, spelling of certain common two-word phrases has evolved into a single word. For example, “someone” used to be the two-word phrase “some one,” which would read awkwardly to modern readers. This is our chance to modernize such phrases.
-Note that we use the
+interactive-sr
tool to perform an interactive search and replace, instead of doing a global, non-interactive search and replace. This is because some phrases caught by the regular expression should not be changed, depending on context. For example, "some one" in the following snippet from Anton Chekhov’s short fiction should not be corrected:Note that we use
se interactive-sr
to perform an interactive search and replace, instead of doing a global, non-interactive search and replace. This is because some phrases caught by the regular expression should not be changed, depending on context. For example, "some one" in the following snippet from Anton Chekhov’s short fiction should not be corrected:He wanted to think of some one part of nature as yet untouched...
Use the following regular expression invocations to correct a certain set of such phrases:
~/tools/interactive-sr "/\v([Ss])ome one/\1omeone/" src/epub/text/* git add -A git commit -m "[Editorial] some one -> someone"
~/tools/interactive-sr "/\v(<[Aa])ny one/\1nyone/" src/epub/text/* git add -A git commit -m "[Editorial] any one -> anyone"
~/tools/interactive-sr "/\v([Ee])very one(\s+of)@\!/\1veryone/" src/epub/text/* git add -A git commit -m "[Editorial] every one -> everyone"
~/tools/interactive-sr "/\v([Ee])very thing/\1verything/" src/epub/text/* git add -A git commit -m "[Editorial] every thing -> everything"
~/tools/interactive-sr "/\v(<[Aa])ny thing/\1nything/" src/epub/text/* git add -A git commit -m "[Editorial] any thing -> anything"
~/tools/interactive-sr "/\v([Ff])or ever(>)/\1orever\2/" src/epub/text/* git add -A git commit -m "[Editorial] for ever -> forever"
~/tools/interactive-sr "/\v(in\s+)@<\!(<[Aa])ny way/\1nyway/" src/epub/text/* git add -A git commit -m "[Editorial] any way -> anyway"
~/tools/interactive-sr "/\v([Yy])our self/\1ourself/" src/epub/text/* git add -A git commit -m "[Editorial] your self -> yourself"
~/tools/interactive-sr "/\v([Mm])ean time/\1eantime/" src/epub/text/* git add -A git commit -m "[Editorial] mean time -> meantime"
~/tools/interactive-sr "/\v([Aa])ny how/\1nyhow/" src/epub/text/* git add -A git commit -m "[Editorial] any how -> anyhow"
+Use the following regular expression invocations to correct a certain set of such phrases:
se interactive-sr "/\v([Ss])ome one/\1omeone/" src/epub/text/* git add -A git commit -m "[Editorial] some one -> someone"
se interactive-sr "/\v(<[Aa])ny one/\1nyone/" src/epub/text/* git add -A git commit -m "[Editorial] any one -> anyone"
se interactive-sr "/\v([Ee])very one(\s+of)@\!/\1veryone/" src/epub/text/* git add -A git commit -m "[Editorial] every one -> everyone"
se interactive-sr "/\v([Ee])very thing/\1verything/" src/epub/text/* git add -A git commit -m "[Editorial] every thing -> everything"
se interactive-sr "/\v(<[Aa])ny thing/\1nything/" src/epub/text/* git add -A git commit -m "[Editorial] any thing -> anything"
se interactive-sr "/\v([Ff])or ever(>)/\1orever\2/" src/epub/text/* git add -A git commit -m "[Editorial] for ever -> forever"
se interactive-sr "/\v(in\s+)@<\!(<[Aa])ny way/\1nyway/" src/epub/text/* git add -A git commit -m "[Editorial] any way -> anyway"
se interactive-sr "/\v([Yy])our self/\1ourself/" src/epub/text/* git add -A git commit -m "[Editorial] your self -> yourself"
se interactive-sr "/\v([Mm])ean time/\1eantime/" src/epub/text/* git add -A git commit -m "[Editorial] mean time -> meantime"
se interactive-sr "/\v([Aa])ny how/\1nyhow/" src/epub/text/* git add -A git commit -m "[Editorial] any how -> anyhow"
-~/tools/interactive-sr "/\v([Aa])ny body/\1nybody/" src/epub/text/* git add -A git commit -m "[Editorial] any body -> anybody"
+se interactive-sr "/\v([Aa])ny body/\1nybody/" src/epub/text/* git add -A git commit -m "[Editorial] any body -> anybody"
-~/tools/interactive-sr "/\v([Ee])very body/\1verybody/" src/epub/text/* git add -A git commit -m "[Editorial] every body -> everybody"
+se interactive-sr "/\v([Ee])very body/\1verybody/" src/epub/text/* git add -A git commit -m "[Editorial] every body -> everybody"
-
Create the cover image
@@ -295,7 +300,7 @@ require_once('Core.php');You must provide proof of public domain status to the SE Editor-in-Chief in the form of a page scan of the painting from a 1923-or-older book, and the Editor-in-Chief must approve your selection before you can commit it to your repository.
-
-
The Standard Ebooks lead has the final say on the cover image you pick, and it may be rejected for, among other things, poor public domain status research, being too low resolution, or not fitting in with the “fine art” style.
+The Standard Ebooks Editor-in-Chief has the final say on the cover image you pick, and it may be rejected for, among other things, poor public domain status research, being too low resolution, not fitting in with the “fine art” style, or being otherwise inappropriate for your ebook.
-
-
+cover.svg
is the completed cover image with the title and author. Thebuild-images
tool will takecover.svg
, embedcover.jpg
, convert the text to paths, and place the result in./src/epub/images/
for inclusion in the final epub.cover.svg
is the completed cover image with the title and author.se build-images
will takecover.svg
, embedcover.jpg
, convert the text to paths, and place the result in./src/epub/images/
for inclusion in the final epub. -
Create the titlepage image, build both the cover and titlepage, and commit
Titlepage images for Standard Ebooks books are also standardized. See our the art manual for details.
-The
-create-draft
tool already created a completed titlepage for you. If the way it arranged the lines doesn’t look great, you can always edit the titlepage to make the arrangement of words on each line more aesthetically pleasing. Don’t use a vector editing program like Inkscape to edit it. Instead, open it up in your favorite text editor and type the values in directly.The source images for both the cover and the titlepage are kept in
./images/
. Since the source images refer to installed fonts, and since we can’t include those fonts in our final ebook without having to include a license, we have to convert that text to paths for final distribution. Thebuild-images
tool does just that.~/tools/build-images .
-This tool takes both
+./images/cover.svg
and./images/titlepage.svg
, converts text to paths, and embeds the cover jpg. The output goes to./src/epub/images/
.
+se create-draft
already created a completed titlepage for you. If the way it arranged the lines doesn’t look great, you can always edit the titlepage to make the arrangement of words on each line more aesthetically pleasing. Don’t use a vector editing program like Inkscape to edit it. Instead, open it up in your favorite text editor and type the values in directly.The source images for both the cover and the titlepage are kept in
./images/
. Since the source images refer to installed fonts, and since we can’t include those fonts in our final ebook without having to include a license, we have to convert that text to paths for final distribution.se build-images
does just that.se build-images .
+se build-images
takes both./images/cover.svg
and./images/titlepage.svg
, converts text to paths, and embeds the cover jpg. The output goes to./src/epub/images/
.Once we built the images successfully, perform a commit.
git add -A git commit -m "Add cover and titlepage images"
-
@@ -330,14 +335,15 @@ require_once('Core.php');
Complete content.opf
content.opf
is the file that contains the ebook metadata like author, title, description, and reading order. Most of it will be filling in that basic information, and including links to various resources related to the text.The
-content.opf
is standardized. Please see our extensive Metadata Manual for details on how to fill outcontent.opf
.As you complete the metadata, you’ll have to order the spine and the manifest in this file. Fortunately, Standard Ebooks has a tool for that too:
print-manifest-and-spine
. Run this on our source directory and, as you can guess, it’ll print out the<manifest>
and<spine>
tags for this work.~/tools/print-manifest-and-spine .<manifest> <item href="css/core.css" id="core.css" media-type="text/css"/> <item href="css/local.css" id="local.css" media-type="text/css"/> <item href="images/cover.svg" id="cover.svg" media-type="image/svg+xml" properties="cover-image"/> <item href="images/logo.svg" id="logo.svg" media-type="image/svg+xml"/> <item href="images/titlepage.svg" id="titlepage.svg" media-type="image/svg+xml"/> <!--snip all the way to the end..--> <item href="text/colophon.xhtml" id="colophon.xhtml" media-type="application/xhtml+xml"/> <item href="text/titlepage.xhtml" id="titlepage.xhtml" media-type="application/xhtml+xml" properties="svg"/> <item href="text/unlicense.xhtml" id="unlicense.xhtml" media-type="application/xhtml+xml"/> </manifest> <spine> <itemref idref="titlepage.xhtml"/> <!--snip all the way to the end..--> <itemref idref="colophon.xhtml"/> <itemref idref="unlicense.xhtml"/> </spine>
+As you complete the metadata, you’ll have to order the spine and the manifest in this file. Fortunately, Standard Ebooks has a tool for that too:
+se print-manifest-and-spine
. Run this on our source directory and, as you can guess, it’ll print out the<manifest>
and<spine>
tags for this work.se print-manifest-and-spine .<manifest> <item href="css/core.css" id="core.css" media-type="text/css"/> <item href="css/local.css" id="local.css" media-type="text/css"/> <item href="images/cover.svg" id="cover.svg" media-type="image/svg+xml" properties="cover-image"/> <item href="images/logo.svg" id="logo.svg" media-type="image/svg+xml"/> <item href="images/titlepage.svg" id="titlepage.svg" media-type="image/svg+xml"/> <!--snip all the way to the end..--> <item href="text/colophon.xhtml" id="colophon.xhtml" media-type="application/xhtml+xml"/> <item href="text/titlepage.xhtml" id="titlepage.xhtml" media-type="application/xhtml+xml" properties="svg"/> <item href="text/unlicense.xhtml" id="unlicense.xhtml" media-type="application/xhtml+xml"/> </manifest> <spine> <itemref idref="titlepage.xhtml"/> <!--snip all the way to the end..--> <itemref idref="colophon.xhtml"/> <itemref idref="unlicense.xhtml"/> </spine>
The manifest is already in the correct order and doesn’t need to be edited. The spine, however, will have to be reordered to be in the correct reading order. Once we’ve done that, paste it in to
content.opf
and commit.git add -A git commit -m "Complete content.opf"
-
Complete the colophon
-The
+create-draft
tool put a skeletoncolophon.xhtml
file in the./src/epub/text/
folder. Now that we have the cover image and artist, we can fill out the various fields there. Make sure to credit the original transcribers of the text (generally we assume them to be whoever’s name is on the file we download from Gutenberg) and to include a link back to the Gutenberg text we used, along with a link to any scans we used (from archive.org or hathitrust.org, for example).se create-draft
put a skeletoncolophon.xhtml
file in the./src/epub/text/
folder. Now that we have the cover image and artist, we can fill out the various fields there. Make sure to credit the original transcribers of the text (generally we assume them to be whoever’s name is on the file we download from Gutenberg) and to include a link back to the Gutenberg text we used, along with a link to any scans we used (from archive.org or hathitrust.org, for example).You can also include your own name as the producer of this Standard Ebooks edition. Besides that, the colophon is standardized; don’t get too creative with it.
-The release and updated dates should be the same for the first relase, and they should match the dates in
content.opf
. For now, leave them unchanged, as theprepare-release
tool will automatically fill them in for you as we’ll describe later in this guide.git add -A git commit -m "Complete the colophon"
+The release and updated dates should be the same for the first release, and they should match the dates in
content.opf
. For now, leave them unchanged, asse prepare-release
git add -A git commit -m "Complete the colophon"
-
Complete the imprint
@@ -346,15 +352,15 @@ require_once('Core.php'); -
Clean and lint before building
Before you build the final ebook for you to proofread, it’s a good idea to check the ebook for some common problems you might run in to during production.
-First, run
+clean
one more time to both clean up the source files, and to alert you if there are XHTML parsing errors. Even though we ran theclean
tool before, it’s likely that in the course of production the ebook got in to less-than-perfect markup formatting. Remember you can runclean
as many times as you want—it should always produce the same output.First, run
se clean
one more time to both clean up the source files, and to alert you if there are XHTML parsing errors. Even though we ranse clean
before, it’s likely that in the course of production the ebook got in to less-than-perfect markup formatting. Remember you can runse clean
as many times as you want—it should always produce the same output.If you’re using a Mac, and thus the badly-behaved Finder program, you may find that it has carelessly polluted your work directory with useless
.DS_Store
files. Before continuing, you should find a better file manager program, then delete all of that litter with the following command:find . -name ".DS_Store" -type f -delete
-Next, run the
lint
tool. If your ebook has any problems, you’ll see some output listing them. If everything’s OK, thenlint
will complete silently.~/tools/clean . ~/tools/lint .
+Next, run
se lint
. If your ebook has any problems, you’ll see some output listing them. If everything’s OK, thense lint
will complete silently.se clean . se lint .
-
Build and proofread, proofread, proofread!
-At this point we’re just about ready to build our proofreading draft! The
-build
tool does this for us. We’ll run it with the--check
flag to make sure the epub we produced is valid, and with the--kindle
and--kobo
flag to build a file for Kindles and Kobos too. If you won’t be using a Kindle or Kobo, you can omit those flags.~/tools/build --output-dir=$HOME/dist/ --kindle --kobo --check .
+At this point we’re just about ready to build our proofreading draft!
+se build
does this for us. We’ll run it with the--check
flag to make sure the epub we produced is valid, and with the--kindle
and--kobo
flag to build a file for Kindles and Kobos too. If you won’t be using a Kindle or Kobo, you can omit those flags.se build --output-dir=$HOME/dist/ --kindle --kobo --check .
If there are no errors, we’ll see five files in the brand-new
~/dist/
folder in our home directory:- @@ -388,21 +394,21 @@ require_once('Core.php');
-
Initial publication
Now that we’ve proofread the work and corrected any errors we’ve found, we’re ready to release the finished ebook!
-It’s a good idea to run
+typogrify
andclean
one more time before releasing. Make sure to review the changes withgit difftool
before accepting them—typogrify
is usually right, but not always!It’s a good idea to run
se typogrify
andse clean
one more time before releasing. Make sure to review the changes withgit difftool
before accepting them—se typogrify
is usually right, but not always!-
If you’re submitting your ebook to Standard Ebooks for review:
-Don’t run
+prepare-release
on an ebook you’re submitting for review!Don’t run
se prepare-release
on an ebook you’re submitting for review!Contact the mailing list with a link to your GitHub repository to let them know you’re finished. A reviewer will review your production and work with you to fix any issues. They’ll then release the ebook for you.
-
If you’re producing this ebook for yourself, not for release at Standard Ebooks:
-Complete the initial publication by adding a release date, modification date, and final word count to
-content.opf
andcolophon.xhtml
. Theprepare-release
tool does all of that for us.~/tools/prepare-release .
+Complete the initial publication by adding a release date, modification date, and final word count to
+content.opf
andcolophon.xhtml
.se prepare-release
does all of that for us.se prepare-release .
With that done, we commit again using a commit message of “Initial publication” to signify that we’re all done with production, and now expect only proofreading corrections to be committed. (This may not actually be the case in reality, but it’s still a nice milestone to have.)
git add -A git commit -m "Initial publication"
Finally, build everything again.
~/tools/build --output-dir=$HOME/dist/ --kindle --kobo --check .
+Finally, build everything again.
se build --output-dir=$HOME/dist/ --kindle --kobo --check .
If the build completed successfully, congratulations! You’ve just finished producing a Standard Ebook!
-
What can we use for Jekyll? In 1885 Albert Edelfelt painted a portrait of Louis Pasteur in a laboratory. A crop of the lab equipment would be a good way to represent Dr. Jekyll’s lab.
@@ -309,16 +314,16 @@ require_once('Core.php');cover.jpg
is the scaled cover image that cover.svg
links to. This file is exactly 1400 × 2100. For Jekyll, this is a crop of cover.source.jpg
that includes just the lab equipment, and resized up to our target resolution.
Do not use the Unicode Roman numeral glyphs, as they are deprecated; use regular letters.
Convert all-caps or small-caps titles to title case. Use the titlecase
script in the Standard Ebooks toolset for consisent titlecasing.
Convert all-caps or small-caps titles to title case. Use the se titlecase
script in the Standard Ebooks toolset for consistent titlecasing.
Remove trailing periods from chapter titles.
diff --git a/www/css/core.css b/www/css/core.css index d8ff711e..e4d5afaa 100644 --- a/www/css/core.css +++ b/www/css/core.css @@ -1093,7 +1093,7 @@ code.css.full::before{ code{ font-family: 'Source Code Pro', monospace; - font-size: .9rem; + font-size: .8rem; } code.terminal{