diff --git a/www/contribute/producing-an-ebook-step-by-step.php b/www/contribute/producing-an-ebook-step-by-step.php index de3e0063..9de6a4cc 100644 --- a/www/contribute/producing-an-ebook-step-by-step.php +++ b/www/contribute/producing-an-ebook-step-by-step.php @@ -108,19 +108,19 @@ require_once('Core.php');
  1. With the --pg-id option

    -

    You can pass se create-draft the ID of 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-id=43 cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/ -

    If the book you’re working on was translated into English from another language, you’ll need to include the translator as well, using the --translator argument. (For translated books that don’t have a translator credited, you can use the name of the publisher for this argument.)

    se create-draft --author="Leo Tolstoy" --translator="Louise Maude" --title="Resurrection" --pg-id=1938 cd leo-tolstoy_resurrection_louise-maude/ -

    In the unusual case that your book has multiple translators, you will include each one by putting each translator’s name in quotation marks after the --translator argument, like so:

    se create-draft --author="Leo Tolstoy" --translator "Louise Maude" "Aylmer Maude" --title="The Power of Darkness" --pg-id=26661 cd leo-tolstoy_the-power-of-darkness_louise-maude_aylmer-maude/ +

    You can pass se create-draft the ID of 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-id 43 cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/ +

    If the book you’re working on was translated into English from another language, you’ll need to include the translator as well, using the --translator argument. (For translated books that don’t have a translator credited, you can use the name of the publisher for this argument.)

    se create-draft --author "Leo Tolstoy" --translator "Louise Maude" --title "Resurrection" --pg-id 1938 cd leo-tolstoy_resurrection_louise-maude/ +

    In the unusual case that your book has multiple translators, you will include each one by putting each translator’s name in quotation marks after the --translator argument, like so:

    se create-draft --author "Leo Tolstoy" --translator "Louise Maude" "Aylmer Maude" --title "The Power of Darkness" --pg-id 26661 cd leo-tolstoy_the-power-of-darkness_louise-maude_aylmer-maude/

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

    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

    The output is text/html; charset=iso-8859-1. That’s the wrong encoding!

    -

    We can convert that to UTF-8 with iconv:

    iconv --from-code="ISO-8859-1" --to-code="UTF-8" < src/epub/text/body.xhtml > src/epub/text/tmp mv src/epub/text/tmp src/epub/text/body.xhtml +

    We can convert that to UTF-8 with iconv:

    iconv --from-code "ISO-8859-1" --to-code "UTF-8" < src/epub/text/body.xhtml > src/epub/text/tmp mv src/epub/text/tmp src/epub/text/body.xhtml