i have no idea what my method is right now.
i spent ( too ) long ( trying ) to make blockly work, sweeping under the rug issues i saw ( from the beginning ):
- blocks can’t line wrap.
- mutator buttons are odd, hard to understand.
- the palette doesn’t change based on context.
long lines
and things i ran into along the way:
- lines with nesting look jittery
- you need custom code (why?) to write mutations ( and it’s often non-trivial )
- writing story text should be easy; block snapping wasn’t doing it for me.
- too many formats needed for describing blocks: xml, json, javascript.
- mismatches b/t the described formats and blockly’s internal representation ( msg/arg blocks; fields start as peers of inputs, but become children of inputs ) and those mismatches make blockly hard to alter ( leaky abstractions )
jagged lines
i really wanted to use something off the shelf. it just didn’t come together.
so now i am trying to write a custom story editor. only…. how?
basically, i started by first describing the json format i would have wanted for blockly; then working on some (pen-and-paper) ui concepts ( especially around how to handle the things blockly does poorly: optional and repeating values ); and now, trying to figure out how to make all that happen.
baby steps. hoping that – unlike my attempt at a blockly editor – those steps pan out. ( noting that working with blockly, seeing what worked and what didn’t, and having to work through formalizing a grammar – were all good steps in and of themselves. )