Expand description
§Document Editor Surface
Typed mutators for Document and Card with invariant enforcement.
§Invariants
Every successful mutator call leaves the document in a state that:
- Contains no reserved key in any card’s frontmatter (
BODY,CARDS,QUILL,CARD). - Has every composable
card.tag()passingsentinel::is_valid_tag_name. - Can be safely serialized via
Document::to_plate_json.
Mutators never modify warnings. Warnings are parse-time observations
and remain stable for the lifetime of the document.
§Surface
Frontmatter and body mutators live on Card:
doc.main_mut().set_field(…), doc.main_mut().replace_body(…),
doc.cards_mut()[i].set_field(…). Document keeps only document-level
operations (quill-ref, push/insert/remove/move card).
Enums§
- Edit
Error - Errors returned by document and card mutators.
Constants§
- RESERVED_
NAMES - Reserved field names that may not appear in any
Card’s frontmatter. These are the sentinel keys whose presence in user-visible fields would corrupt the plate wire format or the parser’s structural invariants.
Functions§
- is_
reserved_ name - Returns
trueifnameis one of the four reserved sentinel names. - is_
valid_ field_ name - Returns
trueifnameis a valid frontmatter / card field name.