Skip to content

Exploring the idea of notational freedom in the context of Block-based langauges. What if you could define a block-based language using a block-based language?

Notifications You must be signed in to change notification settings

d3sprog/metablocks

Repository files navigation

metablocks

Getting Started

To install dependencies:

bun install

To build bundle (Necessary until we're done with the Advanced Playground:)

bun run build

To run:

bun run start

Saving and Loading

loading back state:

copypaste dump.json contents into console as var dump

p = await window.playground;
w = await p.getWorkspace();
Blockly.serialization.workspaces.load(dump,w)

In order to avoid mucking about with the fetch API, it is probably easiest to copypaste the relevant dump into local storage.

Chromium: dev tools -> application -> storage -> Local Storage -> Firefox: dev tools -> storage -> Local Storage

create a new variable, and dump the contents of the JSON file into it.

Assume the new local storage entry is called foobar:

foobar_loaded  = JSON.parse(localStorage.getItem("foobar"));
Blockly.serialization.workspaces.load(foobar_loaded,window.ws);

In order to save:

foobar_saved = Blockly.serialization.workspaces.save(window.ws);
localStorage.setItem("foobar",JSON.stringify(foobar_saved));

About

Exploring the idea of notational freedom in the context of Block-based langauges. What if you could define a block-based language using a block-based language?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •