Standard Ebooks Manual of Style

repository·master·Indexed 41 days ago

https://github.com/standardebooks/manual

A declarative guide defining the expected final appearance and semantic structure of Standard Ebooks. It provides rules for editing, typography, and code style, including technical specifications for SVG cover and titlepage images, US-PD clearance procedures for artwork, and instructions for building the manual using reStructuredText (RST).

Tokens
41.7K
Snippets
102
Records
154
Agent score
51%

What's inside Standard Ebooks Manual

  1. Understand the Standard Ebooks Manual of Style

    master

    The Standard Ebooks Manual of Style provides a comprehensive framework for editing and producing ebooks. It covers everything from internal code style (XHTML, CSS, SVG) to semantic enhancement, typography, and metadata.

    Key Principles:

    • Fallback Rule: If a specific rule is not covered in this manual, producers must follow the latest edition of the Chicago Manual of Style.
    • Modernization: Producers are expected to adjust older conventions (e.g., from books published before the 20th century) to match the modern rules defined in this manual.
    • Discretion: While the manual provides strict directives, producers are encouraged to use professional judgment for literary exceptions where a rule might conflict with the art of the book. When in doubt, contact the Standard Ebooks Editor in Chief via the Google Group.
  2. Follow XHTML file naming conventions

    master

    XHTML filenames must follow specific patterns based on the structure of the work. Note that numbers in filenames do not include leading zeros.

    Naming Patterns

    • Short Works: Use the URL-safe title (e.g., the-variable-man.xhtml).
    • Part Divisions: Name files after the part type followed by a number starting at 1 (e.g., book-1.xhtml, part-2.xhtml).
    • Chapters (Single Volume): Use chapter-N.xhtml where N is the chapter number (e.g., chapter-1.xhtml).
    • Chapters (Multi-Volume, Restarting Numbers): Use chapter-X-N.xhtml where X is the part number and N is the chapter number within that part (e.g., chapter-1-1.xhtml).
    • Chapters (Multi-Volume, Continuous Numbers): Use chapter-N.xhtml where N is the continuous chapter number (e.g., chapter-4.xhtml).
    • Short Sections (e.g., Poems): Use a single file with the URL-safe name of the work (e.g., north-of-boston.xhtml).
    • Frontmatter/Backmatter: Name files after the section type (e.g., preface.xhtml). If multiple sections of the same type exist, use a suffix (e.g., preface-1.xhtml, preface-2.xhtml).
    • Illustrations: Use illustration-N.xhtml where N is the order of appearance (e.g., illustration-1.xhtml).
  3. Configure the Colophon and Copyright Page

    master

    Standard Ebooks uses specific patterns for these concluding elements:

    • Colophon: Contains information about the publisher, author, original publication date, edition, and cover artist. Standard Ebooks colophons follow a standardized pattern.
    • Copyright Page: Explains the copyright status of the work. While usually in the front matter, for Standard Ebooks productions, the copyright page is placed in the back matter as the final item in the book.
  4. Structure and semantic inflection for Letters

    master

    Letters in the project must be wrapped in a <blockquote> element with the semantic inflection epub:type="z3998:letter".

    Special handling applies to telegrams: they must include the HTML class telegram, which applies font-variant: all-small-caps; via CSS.

    When a letter is wrapped in a <blockquote>, any nested <header> or <footer> elements must include role="presentation" to maintain proper semantic structure.

    <blockquote epub:type="z3998:letter">
      <!-- Letter content -->
    </blockquote>
    
    <!-- For telegrams -->
    <blockquote epub:type="z3998:letter" class="telegram">
      <!-- Telegram content -->
    </blockquote>
  5. Use versioning placeholders in RST

    master

    The build process automatically replaces specific strings in .rst files:

    • VERSION: Replaced with the manual's version number (defined in index.rst). This is useful for creating version-specific links, e.g., `Link </manual/VERSION/path>`__.
    • PD_YEAR: Replaced with the current public domain year (e.g., 1926).
    • PD_STRING: Replaced with the date the public domain ends (e.g., January 1, 1927).
  6. Construct the ebook title string

    master

    The title string is a single sentence used in various templates that lists the work's title, author, and contributors. Follow this algorithm:

    1. Start with an empty string.
    2. Append the title of the work (exclude subtitles).
    3. Append , by followed by the author(s):
      • Two authors: separate with and.
      • Three or more authors: separate with , and use , and before the final author.
    4. If there is a translator: append . Translated by followed by the translator name(s) (use the same multiple-name logic as authors).
    5. If there is an illustrator: append . Illustrated by followed by the illustrator name(s) (use the same multiple-name logic as authors).

    Note: The title string may contain periods but must never end with a period.

  7. Understand the three major ebook partitions

    master

    Ebooks are organized into three primary partitions. These partitions are critical when building the Table of Contents (ToC), as the Landmarks section of the ToC requires items to be labeled with the appropriate partition identifier.

    1. Front Matter: Material appearing before the main content (e.g., dedication, epigraph, introduction).
    2. Body Matter: The main content of the book, typically divided into chapters, stories, or poems.
    3. Back Matter: Material following the main content (e.g., endnotes, appendix, afterword).

    Note: While the order below follows a typical book structure, exceptions may be made.

  8. Cover image layout and typography rules

    master

    The cover layout follows strict design constraints to ensure consistency across editions:

    • Typography: Both title and author use the League Spartan font with 5px letter spacing in ALL CAPS.
    • Author Rules: If the author is Anonymous, the author line is omitted. Translators, illustrators, and other contributors are not included on the cover.
    • Title Box: The black title box is horizontally centered. It must have at least 40px padding on the left and right sides.
    • Title Line Dimensions:
      • One-line titles: 80px tall.
      • Two-line titles: Each line is 80px tall, with 20px spacing between lines.
      • Two-line, very long titles: Each line is 60px tall, with 20px spacing.
      • Two-line, extremely long titles: Each line is 50px tall, with 20px spacing.
    • Author Line Dimensions:
      • The first author line starts 60px below the last title line.
      • One-line authors: 40px tall.
      • Two-line authors: Each line is 40px tall, with 20px spacing between lines.
  9. Manage ebook metadata in content.opf

    master

    Metadata for a Standard Ebook is stored in the ./src/epub/content.opf file. This file follows the structure generated by the se create-draft command.

    Important Rules:

    • Do not rearrange the order of elements in the file.
    • Metadata makes heavy use of Schema.org metadata.
    • URLs used in metadata should use https where possible and should not contain query strings (unless the minimum necessary query string is required to render the base resource).
  10. Use <hgroup> for multi-component section titles

    master

    Use the <hgroup> element when a section's title consists of multiple components, such as a title and a subtitle, or an ordinal and a title.

    Structure requirements:

    • An <hgroup> must contain exactly one <h1>–<h6> child.
    • Any additional title components (like subtitles) must be <p> children.
    • <hgroup> should only be used if more than one title element is being grouped.
    <hgroup>
      <h2 epub:type="title">Between the Scenes</h2>
      <p epub:type="subtitle">Progress of the Story Through the Post</p>
    </hgroup>