Apply structured edits to a spec
apply_editsApply edit operations to a document spec to update its content losslessly. Use replace, set, append, or remove ops to modify the spec.
Instructions
Apply a list of edit ops (replace | set | append | remove) to a spec and return the edited, re-validated spec. The caller re-renders the result. Because the spec is the source of truth, editing the spec (not the bytes) is lossless.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | Edit ops: {op:'set',path,value} | {op:'append',target,value} | {op:'remove',target,index} | {op:'replace',value}. | |
| spec | Yes | The current spec. | |
| format | Yes | xlsx | pptx | docx |