Snapblocks (Part 1)

Ah! I see. Thanks.

Alright, I've added block wrapping and zebra coloring to all the styles, so now I'm going to try to get ready for a 1.1.0 release.

I have released v1.1.0 with the changes that I've been posting about.

v1.1.0

Additions

  • Added new snap-flat style. This is the Snap! flat design style.
  • Added zebra coloring. This needs to be enabled with the zebraColoriing option.
  • Added block wrapping. This needs to be enabled with the wrap option. You can also set the minimum width needed to wrap with the wrapSize option. If you don't know how to use these, you can look in the index.html file in the main repo (hopefully I can create some actual api documentation to make it easier to find).
  • Added special Snavanced (formerly Super-Snap!) this script block support.
  • Added + formatting in custom block prototypes. If you set the override to define+ it will automatically place all the plus signs between the fragments.
  • \+ will force the + to not be formatted, likewise @+ will force the + to be formatted (it is technically an icon).
  • Add @camera, @circle or @circleSolid, and @notes () icons.

Changes

  • This is very important. I have changed snapblocks to export as snapblocks isntead of scratchblocks. If you want, you can just do var scratchblocks = snapblocks to easily transition to this new update.
  • C-shapes are created if there is a newline after a {, otherwise it's an embedded script (for rings).
  • Any menu can be editable or readonly. Capital V is readonly, and lowercase v is editable (all menus are readonly in the scratch 3 style).

Fixes

  • Updated Snap! style to look more like Snap!.
  • Fix grey rings in the Scratch 3 style.
  • Fix lines in multiline blocks to have consistent spacing.
  • Multiline grey rings are now round.
  • Multiline hat blocks how have the hat block top (needed for block variables in custom block prototypes).
  • Fixed the if else reporter not detecting.

This is very fun!
However, if I export to SVG and put it on the forums they look BLACK.
Also, if I use the code:

return []

It won't become control-cap, but instead red.

Two "i"s, really?

That was a typo, it's zebraColoring

I just released v1.1.1 which fixes an error with comments.

This is cool

I found your Snapblocks Extension in Miraheze
Screenshot 2024-02-22 at 9.59.26 AM

Yup, @r4356th requested it, and we both worked on the actual extension.

Could a documentation/tutorial page be created for this similar to this wiki page? Block Plugin - Scratch Wiki

(I could make it if nobody else wants to)

I'm actually working on one right now, but instead it's going to be on a new page on the snapblocks site (mainly because the snap wiki hasn't gotten snapblocks yet).

Hey guys, I finally got a documentation website set up (or at least the repo, I need to do a bit more work to get the website up). If you want to help me fix up the documentation, please do.

Alright, I had to fix a few things with the actual website before it could be published (serverside rendering was not working). Here it is. Hopefully I can actually get to work on the actual contents of the site now.

Text is broken in the docs:

(but on the snapblocks itself)

Yes, I know why that's happening, and it will be fixed in snapblocks 1.2.0.

Just show the first snapblocks result, it fixes it.

wtf this is a scatchblocks mod? i thought this was a script pic!

Well I guess that's a sign that it's very accurate.

Did I do something wrong?
This is my code:

<html>
    <body>
        <script src="snapblocks.min.js"></script>
        <pre class="blocks">
            when flag clicked
            move (10) steps
        </pre>
        <script>
            snapblocks.renderMatching('pre.blocks', {
              style:     'snap',       // Optional, defaults to 'snap'.
              languages: ['en', 'de'], // Optional, defaults to ['en'].
              scale: 1,                // Optional, defaults to 1
            });
        </script>
    </body>
</html>

and this is the result
image

It's because you're loading the language de without the translations-all.js file. If you remove de, or add the translations-all.js file, it will work (and if I'm being honest, you probably don't need translations, as they are kind of broken).