Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

show

Open a file, an asset or text you wrote in the editor so the user can read or review it. Each call opens a new, closable editor panel beside whatever the user has open, in the viewer they would get by navigating there themselves: code and text in an editor, markdown rendered, an image drawn, an asset with a preview (bundle, mesh, material, effect, avatar, …) rendered live so they can orbit it.

  • file — a VFS file, folder or asset (by path, name, identity or guid).
  • text — text you produced: a write-up (format = "md"), code, or JSON. A table is pretty-printed as JSON. The text is written to a scratch file under /zero/source/tmp/show/ and the result names it.
  • list — the panels open now, and which ones hold unsaved edits.
  • close — close one you opened.

Show it, then work on it together. A shown panel is editable where the file is text and follows the file on disk: write the file and the user sees the change in place; read the file back to see what they changed. When they have unsaved edits and you write the file, their edits are kept and they are asked whether to reload.

Needs the editor dock, so it answers in the windowed editor. When the dock is not up, the error names the actual cause: a headless engine mounts no editor shell, the runtime profile mounts none either, and a windowed editor whose shell has not mounted yet says to call again in a moment.