Skip to main content

project

The projects this machine has opened, the templates a new one starts from, and the folder picker the OS provides. What the editor's start screen is made of.

11 functions, 0 constants. Scripts reach it as project::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

functionacts onwhat it does
copy_example(string, string) -> anyCopy one example into into under its own name, so the shipped one stays as it is. Answers { path, name }, or { error }.
create(string, string) -> anyWrite a new project at path from a template id, or from nothing when the id is empty. Answers { path, name }, or { error }.
examples() -> anyThe example projects shipped beside the editor: { id, name, note, cover, path } each, where cover is a picture the editor's own project holds, or empty.
forget(string) -> anyDrop one project from the list. The folder is not touched.
home() -> anyWhere a new project goes unless the reader says otherwise: the home directory on a desktop, and the app's own writable directory where there is no such thing.
in_tab() -> anyWhether this editor runs in a browser tab, where the page holds the projects and opening one is its call rather than this screen's.
open(string) -> anyRemember path and start the editor on it, then ask this one to quit. Answers { error } when there is no project there.
pick_folder() -> anyOpen the OS folder picker and answer what was chosen, or () when it was dismissed. Blocks while the dialog is up, and answers () on a platform with no picker.
recent() -> anyThe projects opened on this machine, newest first: { path, name, opened, exists } each, where opened is a Unix time in seconds and exists says whether the folder is still there.
templates() -> anyWhat a new project may start from: { id, note } each, read from the editor's own library.
version() -> anyThe version of the binary the editor is running in.