A monorepo containing jupyter-blocks and jupyter-tidyblocks. Blockly extension for JupyterLab.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #62 from hbcarlos/typo

Fixes typo

authored by

Denisa Checiu and committed by
GitHub
e9b15ccf 59142a3f

+17 -17
+7 -7
docs/other_extensions.md
··· 20 20 jlpm add jupyterlab-blockly 21 21 ``` 22 22 23 - Once it is part of your project, all you need to do is import `IBlocklyRegisty`, as it follows: 23 + Once it is part of your project, all you need to do is import `IBlocklyRegistry`, as it follows: 24 24 ```typescript 25 25 // src/index.ts 26 26 27 - import { IBlocklyRegisty } from 'jupyterlab-blockly'; 27 + import { IBlocklyRegistry } from 'jupyterlab-blockly'; 28 28 ``` 29 29 30 30 The `BlocklyRegistry` is the class that the JupyterLab-Blockly extension exposes to other plugins. This registry allows other plugins to register new Toolboxes, Blocks and Generators that users can use in the Blockly editor. 31 31 32 32 ### Registering new Blocks 33 - The `IBlocklyRegisty` offers a function `registerBlocks`, which allows you to include new Blocks in your project. Blockly offers a [tool](https://blockly-demo.appspot.com/static/demos/blockfactory/index.html) which helps you easily create new Blocks and get their JSON definition and generator code in all supported programming languages. 33 + The `IBlocklyRegistry` offers a function `registerBlocks`, which allows you to include new Blocks in your project. Blockly offers a [tool](https://blockly-demo.appspot.com/static/demos/blockfactory/index.html) which helps you easily create new Blocks and get their JSON definition and generator code in all supported programming languages. 34 34 35 35 **NOTE** : Once you create a new block, it won't appear into your Blockly editor, unless you add it to a Toolbox. 36 36 ··· 46 46 ``` 47 47 48 48 ### Registering a new Toolbox 49 - Using the `registerToolbox` function, provided by `IBlocklyRegisty`, you can register a new toolbox. Once registered, the toolbox will appear automatically in your Blockly editor. You can find more information about switching to another toolbox [here](https://jupyterlab-blockly.readthedocs.io/en/latest/toolbox.html). 49 + Using the `registerToolbox` function, provided by `IBlocklyRegistry`, you can register a new toolbox. Once registered, the toolbox will appear automatically in your Blockly editor. You can find more information about switching to another toolbox [here](https://jupyterlab-blockly.readthedocs.io/en/latest/toolbox.html). 50 50 51 51 ```typescript 52 52 /** ··· 62 62 ``` 63 63 64 64 ### Registering a new Generator 65 - Lastly, `IBlocklyRegisty` offers the function `registerGenerator` which lets you register a new Generator. You can read more about switching kernels [here](https://jupyterlab-blockly.readthedocs.io/en/latest/kernels.html). 65 + Lastly, `IBlocklyRegistry` offers the function `registerGenerator` which lets you register a new Generator. You can read more about switching kernels [here](https://jupyterlab-blockly.readthedocs.io/en/latest/kernels.html). 66 66 67 67 ```typescript 68 68 ··· 98 98 const plugin: JupyterFrontEndPlugin<void> = { 99 99 id: 'jupyterlab-niryo-one:plugin', 100 100 autoStart: true, 101 - requires: [IBlocklyRegisty], 102 - activate: (app: JupyterFrontEnd, blockly: IBlocklyRegisty) => { 101 + requires: [IBlocklyRegistry], 102 + activate: (app: JupyterFrontEnd, blockly: IBlocklyRegistry) => { 103 103 console.log('JupyterLab extension jupyterlab-niryo-one is activated!'); 104 104 105 105 //Registering the new toolbox containing all Niryo One blocks.
+2 -2
package.json
··· 16 16 "eslint:check": "eslint . --ext .ts,.tsx", 17 17 "install": "lerna bootstrap", 18 18 "install:extension": "lerna run install:extension", 19 - "lint": "jlpm stylelint && jlpm prettier && jlpm eslint", 20 - "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check", 19 + "lint": "jlpm prettier && jlpm eslint", 20 + "lint:check": "jlpm prettier:check && jlpm eslint:check", 21 21 "prettier": "jlpm prettier:base --write --list-different", 22 22 "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css}\"", 23 23 "prettier:check": "jlpm prettier:base --check",
+4 -4
packages/blockly-extension/src/index.ts
··· 13 13 import { ISettingRegistry } from '@jupyterlab/settingregistry'; 14 14 15 15 import { BlocklyEditorFactory } from 'jupyterlab-blockly'; 16 - import { IBlocklyRegisty } from 'jupyterlab-blockly'; 16 + import { IBlocklyRegistry } from 'jupyterlab-blockly'; 17 17 import { BlocklyEditor } from 'jupyterlab-blockly'; 18 18 19 19 import { blockly_icon } from './icons'; ··· 37 37 /** 38 38 * Initialization data for the jupyterlab-blocky extension. 39 39 */ 40 - const plugin: JupyterFrontEndPlugin<IBlocklyRegisty> = { 40 + const plugin: JupyterFrontEndPlugin<IBlocklyRegistry> = { 41 41 id: 'jupyterlab-blocky:plugin', 42 42 autoStart: true, 43 43 requires: [ ··· 49 49 ITranslator 50 50 ], 51 51 optional: [ILauncher, ICommandPalette], 52 - provides: IBlocklyRegisty, 52 + provides: IBlocklyRegistry, 53 53 activate: ( 54 54 app: JupyterFrontEnd, 55 55 restorer: ILayoutRestorer, ··· 60 60 translator: ITranslator, 61 61 launcher: ILauncher | null, 62 62 palette: ICommandPalette | null 63 - ): IBlocklyRegisty => { 63 + ): IBlocklyRegistry => { 64 64 console.log('JupyterLab extension jupyterlab-blocky is activated!'); 65 65 66 66 // Namespace for the tracker
+2 -2
packages/blockly/src/registry.ts
··· 8 8 9 9 import En from 'blockly/msg/en'; 10 10 11 - import { IBlocklyRegisty } from './token'; 11 + import { IBlocklyRegistry } from './token'; 12 12 import { TOOLBOX } from './utils'; 13 13 14 14 /** ··· 17 17 * new Toolboxes, Blocks and Generators that users can use in the 18 18 * Blockly editor. 19 19 */ 20 - export class BlocklyRegistry implements IBlocklyRegisty { 20 + export class BlocklyRegistry implements IBlocklyRegistry { 21 21 private _toolboxes: Map<string, JSONObject>; 22 22 private _generators: Map<string, Blockly.Generator>; 23 23
+2 -2
packages/blockly/src/token.ts
··· 5 5 /** 6 6 * The registry token. 7 7 */ 8 - export const IBlocklyRegisty = new Token<IBlocklyRegisty>( 8 + export const IBlocklyRegistry = new Token<IBlocklyRegistry>( 9 9 'jupyterlab-blockly/registry' 10 10 ); 11 11 ··· 15 15 * new Toolboxes, Blocks and Generators that users can use in the 16 16 * Blockly editor. 17 17 */ 18 - export interface IBlocklyRegisty { 18 + export interface IBlocklyRegistry { 19 19 /** 20 20 * Register a toolbox for the editor. 21 21 *