index_mark
Insert a tracked XE field after a text range to index a term or phrase on its page; mark every occurrence, then build the index. Dry-run and undo supported.
Instructions
Mark an index entry: insert an XE field, as a tracked insertion, right after a range (p8#a1b2c3d4:10-15) so that word or phrase is indexed on its page. entry is "Term", or "Term:Sub" / "Term:Sub:Detail" for sub-entries. Mark every occurrence you want listed, then insert the index once with index.insert. Backed up and undoable (history.undo); dry_run previews; expect.sha256 refuses a changed file. Returns the paragraph address and field code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | Yes | A range inside one paragraph; the mark goes after it. | |
| doc | Yes | Path to the .docx. | |
| tag | No | Appended to the author. | |
| entry | Yes | The index entry, e.g. "Term" or "Term:Sub". | |
| author | No | Revision author. | |
| expect | No | Write guard: the sha256 read earlier (doc.info, or a reply's doc.sha256), e.g. {"sha256": "9f86d081…"}; a file changed since is DOC_CHANGED_ON_DISK. | |
| dry_run | No | Preview only; write nothing. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Always true on success. | |
| op | Yes | The operation that ran. | |
| api | Yes | API version (1.0). | |
| doc | No | The document read or written: path, sha256 and paragraph count. | |
| next | Yes | Cursor for the next page (pass as cursor), or null. | |
| result | Yes | What the operation returns. | |
| warnings | Yes | Things to know about the result. |