blockly README

The project's README from github.com/RaspberryPiFoundation/blockly. As one markdown file: README.md.

Blockly

Blockly is a library that adds a visual code editor to web apps. The Blockly editor uses interlocking, graphical blocks to represent code concepts like variables, logical expressions, loops, and more. It allows users to apply programming principles without having to worry about syntax or the intimidation of a blinking cursor on the command line. All code is free and open source.

An example program built with Blockly that checks for a game over state

Getting Started with Blockly

Blockly has many resources for learning how to use the library. You can try a live demo or visit our developer site to read the documentation on how to get started, configure Blockly, and integrate it into your application. The developer site also contains links to:

Installing Blockly

If you're starting a new project using Blockly, you can bootstrap it using our create-package tool:

npx @blockly/create-package app my-cool-blockly-app --typescript

Or, if you're adding Blockly to an existing project, just install it with npm:

npm install blockly

Getting Help

blockly-samples

We have a number of examples which demonstrate various techniques to include and extend the Blockly library. These examples can be found in another repository called blockly-samples.

Plugins

A plugin is a self-contained piece of code that adds functionality to Blockly. Plugins can add fields, define themes, create renderers, and much more. For more information, see the Plugins documentation.

Contributing to Blockly

Want to make Blockly better? We welcome contributions to Blockly in the form of pull requests, bug reports, documentation, answers on the forum, and more! Check out our Contributing Guidelines for more information. You might also want to look for issues tagged "Help Wanted" which are issues we think would be great for external contributors to help with.

Releases

We release new versions on npm and GitHub releases, and then update our docs and demo pages. If there are breaking regressions, such as a crash when performing a standard action or a rendering issue that makes Blockly unusable, we will cherry-pick fixes into patch releases. The releases page has a list of all releases.

We use semantic versioning. Releases that have breaking changes or are otherwise not backwards compatible will have a new major version. Patch versions are reserved for bug-fix patches between scheduled releases.

We now have a beta release on npm. If you'd like to test the upcoming release, or try out a not-yet-released new API, you can use the beta channel with:

npm install blockly@beta

As it is a beta channel, it may be less stable, and the APIs there are subject to change.

Branches

Most development happens in the main branch. Pull requests should typically be made against main. This branch should be stable; features that aren't ready yet should be merged to a feature branch instead. Once something is in main we expect it to be part of the next release. However, features and APIs here are subject to change until they are released. If you're working on a production application using Blockly, you should use the release from npm or the GitHub release page, not the main branch.

Larger changes may have their own branches until they are good enough for people to try out. These will be developed separately until we think they are almost ready for release. They will be merged into main when ready.

New APIs

Once a new API is released, it is considered beta until the following release. We generally try to avoid changing an API after it has been released, but sometimes we need to make changes after seeing how an API is used. If an API has been around for at least two releases we'll do our best to avoid breaking it.

Unreleased APIs may change radically. Anything that is in main but not released is subject to change without warning.

Issues and Milestones

We typically triage all bugs within 1 week, which includes adding any appropriate labels and assigning it to a milestone. Please keep in mind, we are a small team so even feature requests that everyone agrees on may not be prioritized.

Accessibility

Although Blockly is built around drag-and-drop, it is fully usable with the keyboard alone. Blockly is also accessible to screenreader users by default. We provide Accessibility Conformance Reports in the VPAT format that outline Blockly's conformance to WCAG 2.2 Level AA.

blockly (RaspberryPiFoundation/blockly)

Searching Database…

13.6K ·GitHub
这是什么?Blockly 是一个库,可以为网页应用添加拖放式的可视化代码编辑器。它用相互咬合的图形积木来表示变量、逻辑表达式、循环等编程概念,而不是直接书写代码语法。
这是一个独立的应用,还是一个可以嵌入我自己网站的库?它是一个可以嵌入你自己网页应用中的库,本身并不是一个完整的应用。你需要先安装它,再把编辑器集成到你项目的界面中。
怎样把 Blockly 添加到项目中?如果是新项目,就用 create-package 工具来初始化;如果是现有项目,就通过 npm 安装。
使用它需要安装 Node 和 npm 吗?需要。Blockly 通过 npm 分发和安装,而且这个 monorepo 的脚本通过 npx/nx 运行,因此需要配置好 Node.js 和 npm。
这个 API 稳定吗?不同版本之间会不会出问题?主分支上的代码和尚未发布的 API 可能会在没有任何提示的情况下发生重大变化。即使是已发布的 API,也要经过两个版本的检验才会被视为稳定;破坏性变更会提升主版本号。
这个项目主要面向谁?面向正在开发教育类或面向初学者的编程工具的开发者,他们希望让用户通过积木来编程,而不是输入代码语法,从而避免用户面对空白命令行时产生畏难情绪。
无法使用拖放操作的用户能用 Blockly 吗?可以。虽然 Blockly 是围绕拖放操作构建的,但它完全可以只用键盘操作,并且默认支持屏幕阅读器用户。此外,它还发布了 VPAT 格式的无障碍合规报告,对照 WCAG 2.2 AA 级标准。
我能给 Blockly 添加自定义功能吗?可以,通过插件实现。插件是独立的代码模块,可以添加字段、定义主题、创建自定义渲染器等。另外还有一个单独的 blockly-samples 仓库,里面有示例集成方案。
集成之前,有办法先试用 Blockly 吗?有。开发者网站提供在线演示,以及入门文章和代码实验室,方便你在安装之前先学习这个库。
我能提前试用尚未发布的功能吗?可以。npm 上有一个 beta 测试通道,用于测试即将发布的版本和尚未正式发布的 API,不过稳定性可能较差。
What are similar projects?rete, dnd-kit, chakra-ui, plate, handsontable, tambo, MathJax, lexical
Size
184.2 MB
Stars
13.6K
Age
12y
Commits · 90 Days