cric96 / ScaFi-Blocks

Blockly enviroment for generating ScaFi code.

Home Page:https://cric96.github.io/ScaFi-Blocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues MIT License


Logo

ScaFi-Blocks

A Blockly environment developed in Scala.js with a custom code generator for ScaFi.
Try it in Github pages

Table of Contents

About The Project

ScaFi-Blocks is a Blockly environment developed in Scala.js with a custom code generator for ScaFi.

Built With

Getting Started

Prerequisites

Installation

  • Compile optimized Scala.js with SBT :
sbt fullOptJS

Usage

Drag and drop the blocks from the relative categories in the toolbox to create an aggregate program that will be display on the right section.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

Project structure

Config folder

Resource folder

  • index.html contains the layout of the web page of ScaFi-Blocks, styled by the css file main.css.
  • scafi-blocks-utils.js implements some of the facade methods used by Scala to initializes the blocky workspace and also for generating the ScaFi code.

How to add or edit blocks

  1. Open Blockly Developer Tools.
  2. Click on Import Block Library and upload the file config/library.xml.
  3. Define or edit the shape of the blocks using the tool.
  4. Go to Block Exporter, select All Stored in Block Library and export only the Block Definitions overwriting the config/library.json file.
  5. Create or edit the code generator function of the block in the Scala code.
  6. Remember to download the block library xml from Blockly Developer Tools and save it in config/library.xml.

How to add or edit toolbox categories

  1. Open Blockly Developer Tools.
  2. Click on Import Block Library and upload the file config/library.xml.
  3. Go to Workspace Factory section.
  4. Click on Load to Edit and select the config/toolbox.xml.
  5. Define or edit the categories using the tool.
  6. Click Export, select Toolbox and overwrite the config/toolbox.xml file.
  7. Add custom="Functions" attribute to the Functions category in config/toolbox.xml.
  8. Add custom="Definitions" attribute to the Definitions category in config/toolbox.xml.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/cric96/ScaFi-Blocks

Acknowledgements

About

Blockly enviroment for generating ScaFi code.

https://cric96.github.io/ScaFi-Blocks

License:MIT License


Languages

Language:Scala 75.4%Language:JavaScript 19.3%Language:HTML 5.1%Language:CSS 0.2%