Files
aiongg dffc61a7e0 Merge storytold main 832883b5 (sync 16 Nov)
961 upstream commits since 7bb6c900. Resolutions:
- Test-only conflicts: upstream tests from before the base that our side
  cut stay cut; tests new upstream are kept (audio aac/config, layout,
  encode_format; cms lutfile; media mux; print windows_native, ticket;
  update self_update; xml hostile).
- Code our side moved, with upstream's change carried to the new place:
  craft-media mux roll sample groups (mux/boxes.rs) and writer-start
  offsets with overflow checks (mux/progressive.rs); craft-print's
  shrink-to-fit scale guard (sheets/plan.rs); craft-update's nextest
  archive detection (self_update/detect.rs); craft-vectorcraft-format's
  Tail::write_to_with (container.rs); craft-i18n's pedantic fixes
  (bidi.rs, negotiation.rs).
- craft-ui: the old crate's modules stay removed; gpu_test_lock guarded
  their per-test wgpu renderers, which the snapshot kit does not have.
- New upstream tests in crates that build their integration tests into
  the library's test executable are modules of tests/main.rs (audio
  flac_decode and qoa_oracle, cms, docpath, pcraft-format,
  vectorcraft-format).
- The 22 new crates are optional members of the craft facade.
2026-11-16 01:52:09 +00:00
..
…

craft-wordmodel

A word-processing document model: stories, paragraphs, runs, tables, sections, styles, numbering, fields, content controls, notes, comments, revisions, floating objects, drawings and math. It is what the DOCX, RTF, ODT and other text-format crates read into and write from.

It is WordCraft's document model (crates/doc), moved without its editing code. Module paths, type names and serde attributes are as they were, so an app that re-exports the crate keeps its native file format.

use craft_wordmodel::{Block, Document};

let doc = Document::from_text("One\nTwo");
assert_eq!(doc.body.len(), 2);
assert!(matches!(&*doc.body[0], Block::Para(p) if p.text == "One"));

What is here

  • Document: the body story, secondary stories (parts: headers, footers, notes, comments, text boxes), the style sheet, list definitions, comments, revisions, settings, document properties, media and parts kept from the source file.
  • Block, Paragraph, Run, InlineObject, Table: the content. Paragraph text is UTF-8; an inline object stands in the text as U+FFFC (para::OBJ).
  • props, styles, resolve, numbering, section: formatting and its resolution.
  • math, math_latex, math_linear, math_symbols: the equation tree (MNode) and its linear and LaTeX forms.
  • chart, smart_art, graphic, fill, connector, freeform, wordart, effects, picfx, line_dash: drawing objects as the model holds them. Reading and writing their DrawingML is craft-drawingml's job, in the format crates.
  • kept: markup kept from the file a document was read from, so what is not edited is written back as it was.
  • walk, work, geom, bidi, cluster, collate, locale_number, symbol_fonts.

Not here

Range editing, copy and paste, IME text and equation editing stay with the app that edits. Code pages are craft-rtf's codepage, the ZIP entry-count check is craft-opc's.

Limits

The model carries the limits its readers rely on: nesting of tables (table::MAX_TABLE_DEPTH), text boxes (MAX_TEXT_BOX_DEPTH, BoxBudget), math (math::MAX_DEPTH, matrix sizes), group children, alt text length, linked boxes and the walk depth (PARA_WALK_DEPTH). Their tests moved with them.