Fork and customize Block Factory Demo

70 views
Skip to first unread message

Erin Carvalho

unread,
May 11, 2021, 2:57:22 PM5/11/21
to Blockly
Hi all,

So I am working with a client (who isn't super comfortable with code) to create custom blockly libraries. I was planning on using https://blockly-demo.appspot.com/static/demos/blockfactory/index.html to empower them to create their own library and then I would have some import button for them to import it on their own. However, I do feel like that website is somewhat limited as I would like to implement a way for them to put in some code for a custom generator. I found the source code for this site at https://github.com/google/blockly/tree/master/demos/blockfactory but if I run http-server .  from that directory I just get a blank template page. Like the attached image 
Screen Shot 2021-05-11 at 2.55.31 PM.png
How can I actually build this page locally as it exists on https://blockly-demo.appspot.com/static/demos/blockfactory/index.html?

Thanks,
Erin

feni...@google.com

unread,
May 13, 2021, 3:48:36 PM5/13/21
to Blockly
Hi Erin,

That demo expects the blockly library to exist, a few directories up: https://github.com/google/blockly/blob/master/demos/blockfactory/index.html#L7

<script src="../../blockly_compressed.js"></script>
<script src="../../javascript_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<script src="../../blocks_compressed.js"></script>

You could either run http-server from Blockly's root or copy the files into the directory and update index.html to match the new location.

Cheers,
Rachel

Reply all
Reply to author
Forward
0 new messages