leopard-js / sb-edit

Javascript library for manipulating Scratch project files
MIT License
54 stars 15 forks source link

CLI: scratchblocks output #131

Open towerofnix opened 7 months ago

towerofnix commented 7 months ago

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:

PullJosh commented 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.

towerofnix commented 7 months ago

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.