Skip to main content

Module studio_files

Module studio_files 

Source
Expand description

The Studio’s files: the shipped examples, read-only and served from the site itself, over the reader’s own store (the browser’s OPFS, or IndexedDB in a private window).

Every shipped example is compiled into the site, so the Studio never copies one into the reader’s store. /examples is a read-only layer answered from memory, and every other path is the reader’s. Opening the Studio writes nothing, the examples’ part of the file tree exists before any store answers (examples_tree), and a program still reads an example by its path. Copies an earlier Studio wrote under /examples never show, and StudioFiles::retire_old_copies removes them in the background.

Structs§

StudioFiles
The Studio’s files: the shipped examples over the reader’s store.

Constants§

EXAMPLES
Where the shipped examples live.

Functions§

example_at
The shipped example at path.
example_text
The text of the shipped example at path.
examples_tree
The examples’ part of the file tree, in the file browser’s order: what the tree shows before the reader’s store has answered.
load_dir_recursive
Load the folder at path from vfs into parent, every level in the file browser’s order.
open_store
What the Studio asks of its files when it opens: the whole file tree (the examples from the site, the reader’s own files from the store) and the text of path, the file it opened with, or None when there is no such file. It writes nothing.