Open towerofnix opened 7 months ago
One use case I can see for this is if users want to copy a script from a Scratch project into bbcode on the Scratch forums. I'm wondering if it would be useful to provide an interactive terminal output option where you can use arrow keys to select a certain sprite, then arrow keys to select a certain script, and then view that script as scratchblocks and potentially copy it to your clipboard.
That would be really awesome. I wonder how difficult it would be? I think it would be the most useful if you can see a full preview of the script you have selected as you navigate through (and not just, for example, guess based on the top block). But that involves either a full-screen interface or "repainting" a possibly large (e.g. 8-12 lines) region of the terminal. Commander (used in the CLI right now) appears to be much more about just making a useful entry interface, not doing interesting live interaction effects, so we'd probably need to find some other library to handle this stuff.
Following https://github.com/leopard-js/sb-edit/pull/129, we should be able to export to the other formats sb-edit has complete or partial support for.
Some notes:
toScratchblocks
..sb
is used by Scratch 1.4 projects) so we can never infer this output type; it's up to the user to specify-ot scratchblocks
/--output-type scratchblocks
. Otherwise we'll just export the default (when to a folder), which is leopard.toLeopard
's own behavior). There's not really any logic to factor out here since we're skipping costume/sound output and JSZip's own interface is pretty dead simple.