Edit a document
ragdown_editReplace exact passages in an existing Markdown document without rewriting the whole file. Each edit swaps old text for new, deletes with empty text, and all edits apply or none do.
Instructions
Change part of an existing document without sending the rest of it: each edit swaps one exact passage (old_text) for another (new_text). old_text must match the document character for character, as ragdown_read_doc returned it, and be there exactly once unless replace_all is true, so include enough of the surrounding text to make it unique. Edits are made in order, each on the result of the one before, and if any of them does not apply nothing is written. An empty new_text deletes the passage. A passage that is not found is answered with the nearest one the document does have.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of a Markdown file relative to the documents root, e.g. 'projects/alpha.md' | |
| edits | Yes | ||
| base_hash | No | The hash from ragdown_read_doc. Optional: if the file changed since, nothing is written |