Skip to main content

Module edit

Module edit 

Source
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() passing sentinel::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§

EditError
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 true if name is one of the four reserved sentinel names.
is_valid_field_name
Returns true if name is a valid frontmatter / card field name.