google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.51k stars 3.72k forks source link

Document creating a new language generator #6992

Open maribethb opened 1 year ago

maribethb commented 1 year ago

Location

https://developers.google.com/blockly/guides/create-custom-blocks/generating-code

Type

Suggested content

The current page explains how to add a block generator to an existing language generator. It doesn't explain how to create a new language generator entirely. We have the custom generator codelab, but as it is a simple generator, it glosses over some of the details.

In particular, we should tell people about the init method and what kinds of things they may want to initialise there, like the nameDB_.

In lieu of comprehensive text documentation, we could at least encourage people to view the current generators to see what else they may need to initialize. The codelab is a bit misleading here because it covers calling the Generator constructor but doesn't really tell you there might be more things to init.

Additional context

https://groups.google.com/g/blockly/c/j7MfufrANkM

maribethb commented 1 year ago

Additional confusion in #7302

maribethb commented 1 year ago

@BeksOmega I'm going to add one sentence to this page saying there is more you have to do than just this, go look at the existing generators. But this might be a good candidate for your next batch of work after renderers :)

maribethb commented 1 year ago

Also additional confusion here about the tuple message for value blocks. imo the generator docs should have a heading for value blocks that is easy to link to, unlike today's https://groups.google.com/g/blockly/c/a3ZMp_0Sg2M

BeksOmega commented 1 year ago

Blocked by https://github.com/google/blockly/issues/7326