Adding built-in library block

Is there an AI2 version of the documentation on adding built-in library blocks?

I can see that a lot of what's in the version 1 document applies to AI2 as well. If there is no documentation available...would be great if someone can help me understand the following:

  • Looks like the scheme code is defined both in blocklyserver (as js files in src/generators/) as well as in buildserver (in runtime.scm)...are either of those autogenerated from the other or does one have to write the scheme code at both these places manually?
  • Are the documentation generated automatically, and if so how can I update them after adding new built-in blocks?

Thanks!

I have a draft of some instructions for AI2 blocks but there isn't anything publicly available at this time as far as I'm aware.

Specifically, the code in runtime.scm is the code that runs on the phone/tablet. This is where you define the functionality of the language. The block is just an abstraction of the function(s) you define here.

The block definition goes in src/blocks/... and the generator, which translates the block into Scheme, goes in src/generators/yail/....

Block documentation is not generated automatically like the component documentation. You're responsible for manually updating the files in docs/markdown/ and rebuilding the HTML to document your new blocks.

2 Likes

That makes sense...thanks for the clarification, @ewpatton!

1 Like