pub fn to_json(doc: &Document) -> ValueExpand description
Document → JSON.
The schema is the model’s serde derive and is a public contract from here
on: {"meta": {…}, "blocks": [{"type": …}]}, with inline spans adjacently
tagged as {"type": …, "value": …}. See the snapshot test below.