From 4cd0abd034d500c7133726602d563f5a2bfd9b6b Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sun, 24 Nov 2019 13:56:08 -0600 Subject: [PATCH] Update step by step guide with new create-draft flag --- www/contribute/producing-an-ebook-step-by-step.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/contribute/producing-an-ebook-step-by-step.php b/www/contribute/producing-an-ebook-step-by-step.php index a22252ce..a0eb3022 100644 --- a/www/contribute/producing-an-ebook-step-by-step.php +++ b/www/contribute/producing-an-ebook-step-by-step.php @@ -69,13 +69,13 @@ require_once('Core.php');

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 a git repository within it, and prefill a few fields in content.opf (the file that contains the ebook’s metadata).

  1. -

    With the --gutenberg-ebook-url option

    -

    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/ +

    With the --pg-url option

    +

    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" --pg-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.

  2. -

    Without the --gutenberg-ebook-url option

    +

    Without the --pg-url option

    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 it body.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 @@ -101,7 +101,7 @@ require_once('Core.php');

    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.

  3. -

    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.

    +

    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 --pg-url option, then it may have already stripped the license for you and included some Gutenberg metadata.

  4. Now our source file looks something like this: