-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Blocks #21
Comments
Hey @acbart, not sure if you've seen this (understand you're super busy) but wanted to reach out to check if you could point me in the right direction! :) |
Hi @JoshuaLowe1002, sorry for the delay. Things are indeed super busy, and I don't have any docs. However, this is actually pretty easy to do in BlockMirror just by editing the toolbars: https://github.com/blockpy-edu/BlockMirror/blob/master/src/toolbars.js#L66 This is an object mapping toolbox names to their list of categories (and string literals). Each category is an object with The Instead of a category, you can also provide a string literal instead that will be embedded directly. Examples are here for a horizontal separator bar and a special expressions block category: https://github.com/blockpy-edu/BlockMirror/blob/master/src/toolbars.js#L270-L272 Then to actually use a different toolbox, you can pass in And in fact, I apparently also coded it so that you can create custom toolboxes without ever needing to modify the source code. Instead of passing in the name of a predefined name of a toolbox to the If you give it a try and it's successful, feel free to PR some documentation for all of this ;) |
Awesome thank you @acbart ! Managed to get some blocks added which is great. One other quick question. Is there an extra step so that the block is detected when doing python to blocks translation? That doesn't seem to be working for me right now :) |
I'm not sure I know what you mean - the text side is not generating blocks automatically when you edit the text side? |
Hi @acbart
Great work on this, super useful tool.
I was wondering if there was any docs on how to add a simple block into BlockMirror and show in the toolbox? That would be super handy.
Josh
The text was updated successfully, but these errors were encountered: