https://github.com/leeyunjai/blockly-sample
sample code for blockly custom
https://github.com/leeyunjai/blockly-sample
blockly blockly-import python python3
Last synced: 7 months ago
JSON representation
sample code for blockly custom
- Host: GitHub
- URL: https://github.com/leeyunjai/blockly-sample
- Owner: leeyunjai
- Created: 2023-02-10T09:27:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-31T07:04:36.000Z (over 1 year ago)
- Last Synced: 2025-01-24T14:15:41.910Z (9 months ago)
- Topics: blockly, blockly-import, python, python3
- Language: JavaScript
- Homepage:
- Size: 1.16 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blockly Sample Code using Node.js
This repo contains sample code for using Blockly in a Node.js environment.## Included Files
The following files are included in this repository:- main.js
- index.html
- index.js
- static folder (contains blockly_compressed.js, python_compressed.js, blocks_compressed.js, ko.js, pythonblocks.js, and socket.io.min.js)## main.js
This file sets up the Express server and creates a socket connection using socket.io. It also serves the index.html file when the root URL is accessed.## index.html
This file contains the HTML for the user interface. It includes the necessary Blockly and socket.io JavaScript files, as well as buttons for generating code, generating JSON, and loading saved code.## index.js
This file uses the Blockly.inject method to create the Blockly workspace, and sets up event listeners for the buttons in the user interface. The generated code is emitted through the socket connection to the server.## Usage
To run this code, you will need to have Node.js and npm installed. Clone the repository and navigate to the directory in the terminal, then run the following commands:node main.js
```
The user interface can be accessed at `http://localhost:3000`.\
```