From 1977281a85a642c5b2ccf98b76fac05d6d977e70 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Thu, 21 Feb 2019 12:46:11 -0600 Subject: [PATCH] Update docs for new pip-based toolset --- www/contribute/art.php | 12 +- .../producing-an-ebook-step-by-step.php | 116 +++++++++--------- www/contribute/typography.php | 2 +- www/css/core.css | 2 +- 4 files changed, 69 insertions(+), 63 deletions(-) diff --git a/www/contribute/art.php b/www/contribute/art.php index 9a60042d..1b2392a5 100644 --- a/www/contribute/art.php +++ b/www/contribute/art.php @@ -11,7 +11,7 @@ require_once('Core.php');

General notes

@@ -50,7 +50,7 @@ require_once('Core.php');

The SE Editor-in-Chief must review and approve of the cover art you select before you can commit it to your repository.

Do not commit cover art without contacting the mailing list first!

-

There are three cover image templates available to you based on how long the ebook’s title is. create-draft tries to guess which one to use, but it may not be correct. If your novel title is too long to fit in the template create-draft picked for you, you can try a different cover image template. They’re located in the Standard Ebooks tools templates/ folder.

+

There are three cover image templates available to you based on how long the ebook’s title is. create-draft tries to guess which one to use, but it may not be correct. If your novel title is too long to fit in the template create-draft picked for you, you can try a different cover image template. They’re located in the Standard Ebooks toolset TOOLSET-ROOT/se/data/templates/ folder.

To edit DRAFT-ROOT/images/cover.svg, simply open it with your favorite text editor. Replace “NOVEL” with your novel’s title and “AUTHOR” with the author.

Only use a text editor to edit cover.svg, not an SVG editing program like Inkscape. SVG editors like Inkscape often reformat SVGs and insert all sorts of useless metadata.

You must have the free League Spartan font installed on your system for the cover to render and build correctly.

@@ -449,10 +449,10 @@ require_once('Core.php');

Crop or scale the source image to create a 1400w × 2100h image that will be the actual cover background. Name this file DRAFT-ROOT/images/cover.jpg and save it at 75% compression (if that looks good enough).

  • -

    If you used the create-draft script to initialize your repository, then DRAFT-ROOT/images/cover.svg is initialized with the work title and author and what should be the correct font size. If not, copy the cover image template from SE-ROOT/tools/templates/cover.svg into the same directory as cover.jpg. Open your working copy of DRAFT-ROOT/images/cover.svg with a text editor and edit the work name and author, and remove any unused template CSS.

    +

    If you used se create-draft to initialize your repository, then DRAFT-ROOT/images/cover.svg is initialized with the work title and author and what should be the correct font size. If not, copy the cover image template from TOOLSET-ROOT/se/data/templates/cover.svg into the same directory as cover.jpg. Open your working copy of DRAFT-ROOT/images/cover.svg with a text editor and edit the work name and author, and remove any unused template CSS.

  • -

    Finally, generate DRAFT-ROOT/src/epub/images/cover.svg by running the build-images tool. (This script also generates the titlepage images, if available.)

    +

    Finally, generate DRAFT-ROOT/src/epub/images/cover.svg by running se build-images. (This script also generates the titlepage images, if available.)

  • diff --git a/www/contribute/producing-an-ebook-step-by-step.php b/www/contribute/producing-an-ebook-step-by-step.php index cf3a4fd3..676fbf28 100644 --- a/www/contribute/producing-an-ebook-step-by-step.php +++ b/www/contribute/producing-an-ebook-step-by-step.php @@ -5,17 +5,21 @@ require_once('Core.php');

    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).

    1. -

      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.

      +
    2. +
    3. +

      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
    4. Select an ebook to produce

      @@ -62,17 +66,17 @@ require_once('Core.php');
    5. 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 a git repository within it, and prefill a few fields in content.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 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 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.

      2. Without the --gutenberg-ebook-url option

        -

        If 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 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!

        @@ -97,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 used the --gutenberg-ebook-url option with the create-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.

      4. 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
      5. 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 &mdash;. 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 few perl 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 divs and ps. 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');
      6. 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 the titlecase 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 run titlecase 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, and se 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 run se 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: |([0-9])+’|\1′|g, |([0-9])+”|\1″|g

          @@ -178,7 +182,7 @@ require_once('Core.php');

          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]

        • Two-em dashes should be used for elision.

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

      8. 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"
      9. 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:

        1. @@ -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');

          Semantics rules for chapter titles.

        • -

          Semantics rules for abbreviations. Abbreviations should always be wrapped in the abbr tag and with the correct class attribute.

          +

          Semantics rules for abbreviations. Abbreviations should always be wrapped in the <abbr> tag and with the correct class 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 in gold-thread so that it reads goldthread. Well goldthread 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 in gold-thread so that it reads goldthread. Well goldthread 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.

        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.

      10. -

        cover.svg is the completed cover image with the title and author. The build-images tool will take cover.svg, embed cover.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 take cover.svg, embed cover.jpg, convert the text to paths, and place the result in ./src/epub/images/ for inclusion in the final epub.

      11. 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. The build-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"
      12. @@ -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 out content.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"
      13. Complete the colophon

        -

        The create-draft tool put a skeleton colophon.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 skeleton colophon.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 the prepare-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, as se prepare-releasegit add -A git commit -m "Complete the colophon"

      14. Complete the imprint

        @@ -346,15 +352,15 @@ require_once('Core.php');
      15. 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 the clean tool before, it’s likely that in the course of production the ebook got in to less-than-perfect markup formatting. Remember you can run clean 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 ran se clean before, it’s likely that in the course of production the ebook got in to less-than-perfect markup formatting. Remember you can run se 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, then lint 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, then se lint will complete silently.

        se clean . se lint .
      16. 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 and clean one more time before releasing. Make sure to review the changes with git difftool before accepting them—typogrify is usually right, but not always!

          +

          It’s a good idea to run se typogrify and se clean one more time before releasing. Make sure to review the changes with git 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 and colophon.xhtml. The prepare-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 and colophon.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!

      diff --git a/www/contribute/typography.php b/www/contribute/typography.php index 884a5081..f3f90247 100644 --- a/www/contribute/typography.php +++ b/www/contribute/typography.php @@ -64,7 +64,7 @@ require_once('Core.php');

      Do not use the Unicode Roman numeral glyphs, as they are deprecated; use regular letters.

    6. -

      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.

    7. 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{