Insert new content
geml_addInsert new blocks or prose into a GEML or Markdown document—append at the end or place before/after an anchor block. Validates first, refusing missing anchors or clashing ids.
Instructions
Insert new content — one or more blocks, or prose — at the end of the document (position: append) or before/after the block named by anchor. Use this for content that does not exist yet; to change a block that does, use geml_set. Ids inside the content are kept. In a .md file Markdown lands as written, and GEML content is converted to Markdown as to: "md" converts it, the result's notes saying so; content Markdown cannot hold, such as a view without its source, is refused. Like every write here it is validated first: a missing anchor, an id that clashes with an existing one, or content that would break the document is refused. Returns {ok, file, diagnostics, revision}, with notes when the write did something to say out loud (a block it dropped, an address it changed); a refusal is ok: false with a hint, and the file is unchanged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Document path relative to the server's --root directory, e.g. notes/spec.geml | |
| anchor | No | Block id the insertion is relative to; required for before/after | |
| content | Yes | The GEML fragment to insert | |
| position | Yes | Where to insert |