Update step by step guide with new create-draft flag

This commit is contained in:
Alex Cabal 2019-11-24 13:56:08 -06:00
parent a4dabd6cab
commit 4cd0abd034

View file

@ -69,13 +69,13 @@ require_once('Core.php');
<p>You cant just arrange files willy-nilly, though—the epub standard expects certain files in certain places. So once youve picked a book to produce, create the basic epub skeleton in a working directory. <code class="program">se create-draft</code> will create a basic Standard Ebooks epub folder structure, initialize a <code class="program">git</code> repository within it, and prefill a few fields in <code class="path">content.opf</code> (the file that contains the ebooks metadata).</p>
<ol>
<li>
<h3>With the <code class="program">--gutenberg-ebook-url</code> option</h3>
<p>You can pass <code class="program">se create-draft</code> the URL for the Project Gutenberg ebook, and itll try to download the ebook into <code class="path">./src/epub/text/body.xhtml</code> and prefill a lot of metadata for you:</p><code class="terminal"><span>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"</span> <span>cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/</span></code>
<h3>With the <code class="program">--pg-url</code> option</h3>
<p>You can pass <code class="program">se create-draft</code> the URL for the Project Gutenberg ebook, and itll try to download the ebook into <code class="path">./src/epub/text/body.xhtml</code> and prefill a lot of metadata for you:</p><code class="terminal"><span>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"</span> <span>cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/</span></code>
<p>Because Project Gutenberg ebooks are produced in different ways by different people, <code class="program">se create-draft</code> has to make some guesses and it might guess wrong. Make sure to carefully review the data it prefills into <code class="path">./src/epub/text/body.xhtml</code>, <code class="path">./src/epub/text/colophon.xhtml</code>, and <code class="path">./src/epub/content.opf</code>.</p>
<p>In particular, make sure that the Project Gutenberg license is stripped from <code class="path">./src/epub/text/body.xhtml</code>, and that the original transcribers in <code class="path">./src/epub/text/colophon.xhtml</code> and <code class="path">./src/epub/content.opf</code> are presented correctly.</p>
</li>
<li>
<h3>Without the <code class="program">--gutenberg-ebook-url</code> option</h3>
<h3>Without the <code class="program">--pg-url</code> option</h3>
<p>If you prefer to do things by hand, thats an option too.</p><code class="terminal"><span>se create-draft --author="Robert Louis Stevenson" --title="The Strange Case of Dr. Jekyll and Mr. Hyde"</span> <span>cd robert-louis-stevenson_the-strange-case-of-dr-jekyll-and-mr-hyde/</span></code>
<p>Now that we have the skeleton up, well download Gutenbergs HTML file for <i>Jekyll</i> directly into <code class="path">text/</code> folder and name it <code class="path">body.xhtml</code>.</p><code class="terminal"><span>wget -O src/epub/text/body.xhtml https://www.gutenberg.org/files/43/43-h/43-h.htm</span></code>
<p>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 <code class="program">file -I</code>.)</p><code class="terminal"><span>file -bi src/epub/text/body.xhtml</span></code>
@ -101,7 +101,7 @@ require_once('Core.php');
<p>This edition of <i>Jekyll</i> includes a table of contents; remove that too. Standard Ebooks uses the <abbr class="initialism">ToC</abbr> generated by the ereader, and doesnt include one in the readable text.</p>
</li>
<li>
<p>Remove any footer text and markup after the public domain text ends. This includes the Gutenberg license—but dont worry, well credit Gutenberg in the colophon and metadata later. If you invoked <code class="program">se create-draft</code> with the <code class="program">--gutenberg-ebook-url</code> option, then it may have already stripped the license for you and included some Gutenberg metadata.</p>
<p>Remove any footer text and markup after the public domain text ends. This includes the Gutenberg license—but dont worry, well credit Gutenberg in the colophon and metadata later. If you invoked <code class="program">se create-draft</code> with the <code class="program">--pg-url</code> option, then it may have already stripped the license for you and included some Gutenberg metadata.</p>
</li>
</ul>
<p>Now our source file looks something like this:</p>