Skip to main content

Module book

Module book 

Source
Expand description

The semantic document: Book → Sections → Blocks → Inlines.

Structs§

BlockRef
Where a top-level block is: sections[section].blocks[block]. Edits (M4 book_apply) address sections by index and blocks with this; a change inside a quote, list or footnote replaces its top-level block. Positions, not ids stored in the file: ops run one after another on the book held in Rust, so a position is exact when its op runs.
Book
A whole book as imported and edited by the author.
Credit
One credit line on the copyright page.
CustomThemeLink
The link from a book to the custom theme it was designed from (StyleSettings::custom_theme).
Epigraph
Imprint
The rest of the copyright page (DE: Impressum); the © line, ISBNs and edition are in Metadata. German press law asks for the name and address of the publisher (Metadata::publisher; a self-publisher names themselves) and of the printer. Values only, printed as written; the theme adds labels (“Druck:”, “Printed by”) in the book’s language.
Lang
BCP 47 language tag, e.g. en, en-GB, de, de-AT.
Metadata
Section
SectionNumber
A chapter’s or part’s number, from Book::section_numbers.
Series
StyleSettings
Everything about appearance the author chooses. Themes interpret the parameters; unknown parameters are kept for forward compatibility.

Enums§

Block
Every variant carries extra (unknown fields, see Extra); build blocks with the constructors below and match with ...
ImagePlacement
Where a picture stands.
ImageSide
The side a Beside picture stands on.
Inline
Numbering
SectionKind
What role a section plays. Drives page layout (display pages, running heads, numbering) and EPUB semantics (epub:type).

Constants§

KIND_BACK_MATTER
Key for the sections after the last chapter: afterword, acknowledgments, about the author, also-by.
KIND_CHAPTERS
Key in StyleSettings::kinds for the numbered and unnumbered chapters. The mapping from SectionKind to these keys is left to the caller.
KIND_FRONT_MATTER
Key for the sections before the first chapter: dedication, epigraph, foreword and the like.
KIND_PARTS
Key for part pages.
MAX_VERSE_INDENT
The deepest verse indent level the model reads; the importers stop there too. A level is a step in from the verse’s own indent; the themes decide how far.

Type Aliases§

Extra
Fields in book.json that this build does not know, kept as read and written back on save, so a file saved by a newer build loses nothing when an older one re-saves it. Code never puts known field names here; leave it empty when building a value.