Expand description
Manuscript importers. Every importer returns a Book plus warnings and
never fails on odd input.
Only input that is not a manuscript at all (empty, not a .docx) is an
error.
Modules§
- docx
- .docx import.
- markdown
- The Kernsetzer Markdown dialect (M1 extends the M0 subset, see checklist).
- scrub
- The scrambled copy of a manuscript.
Structs§
- Asset
- An image file found in a manuscript, referenced by
Block::Image::asset. An image file, e.g.assets/image1.pngin a project. - Import
Warning - A non-fatal problem found while importing, shown to the author.
- Imported
Enums§
- Import
Error - Read
Error - Why a manuscript file could not be read.
- Warning
Detail - What a warning names. Tagged by
kindwith kebab-case values, fields in snake_case, like the façade’s other enums. - Warning
Kind - What a warning is about, so the UI can group and link warnings and tests can assert on them without matching prose.
Constants§
- MAX_
IMAGE_ BYTES - Largest image we import.
Functions§
- read_
image - An image a Markdown manuscript refers to, relative to its folder. Reads at most one byte over the import limit, so the importer can tell a file that is too large without all of it in memory.
- read_
manuscript - The book, its images and the import warnings, by file extension
(
.md,.markdown,.docx). A Markdown manuscript’s images are read relative to its folder. - unique_
id - File name for an image’s asset: the original base name (
/or\paths), sanitized, with the extension that matches the content, made unique amongassets.