Convert a whole document
geml_toConvert a whole document between GEML, Markdown, JSON, or HTML and return it as text, including importing Markdown to GEML. Use it to read or transform files, then write results with other block tools.
Instructions
Convert a WHOLE document and get the result back as text — the read half of the CLI's geml <file> --to <fmt>. to: "geml" on a Markdown file is the importer, the one thing the block tools cannot do; to: "md" projects a GEML document out (lossy); to: "json" returns the full document model, for when geml_list plus geml_get is not enough. Nothing is written — pass the result to geml_add or geml_set to land it. to: "html" also works but returns a whole self-contained page, usually tens of kilobytes this server cannot save: prefer the CLI (geml <file> --to html -o out.html) unless you want the markup in the conversation. A document with errors returns its diagnostics instead of a conversion, and a file that is not under the server root is an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Target format. Default is the CLI's: a GEML input becomes json, a Markdown input becomes geml. `html` is a whole page — large, and not writable from here. | |
| file | Yes | Document path relative to the server's --root directory, e.g. notes/spec.geml | |
| from | No | Override the input format, which is otherwise inferred from the extension (.md -> md, .json -> json, else geml). |