You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 71064f5
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.rst
+28-3Lines changed: 28 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,12 @@ Developer Setup
11
11
12
12
This editor works with any modern web browser.
13
13
14
+
To grab the GIT submodules you should issue the following command::
15
+
16
+
git submodule update --init --recursive
17
+
18
+
**THIS NEEDS TO BE DONE BEFORE ANYTHING ELSE WILL WORK.**
19
+
14
20
Assuming you have Python 3 installed you can serve the editor like this::
15
21
16
22
$ ./show.sh
@@ -43,14 +49,21 @@ Code
43
49
++++
44
50
45
51
* ace - a directory containing the Ace editor (http://ace.c9.io).
52
+
* blockly - a GIT sub-module containing Google's blockly project.
53
+
* CHANGELOG - a record of how things have changed between versions.
54
+
* CONTRIBUTING.rst - a guide for people who want to contribute (you should!).
46
55
* editor.html - the page to be loaded by your browser.
47
56
* firmware.hex - copy of the "vanilla" MicroPython firmware used by the editor.
48
57
* help.html - a single page user facing help page.
58
+
* LICENSE - a copy of the MIT software license that covers this code.
59
+
* microbit_blocks - a GIT sub-module containing custom MicroPython blocks.
49
60
* python-main.js - the JavaScript code for running the editor.
61
+
* README.rst - this file, the clue is in the name. ;-)
50
62
* tests.html - the browser based test runner.
51
63
* show.sh - a script that allows you to serve the editor from localhost. Requires Python 3.
52
64
* static - contains css, js and img sub-directories.
53
65
* tests - contains the Python specific test suite.
66
+
* tests.html - point your browser at this file to run the tests.
54
67
55
68
Contributing
56
69
++++++++++++
@@ -81,17 +94,22 @@ name and comment. Please note that all query string arguments must be correctly
81
94
URL encoded - this especially applies to code. Use the "share" button in the
82
95
editor to generate and share such URLs with appended query strings.
83
96
84
-
The layout and functionality is deliberately simple. The four buttons at the
97
+
The layout and functionality is deliberately simple. The buttons at the
85
98
top left, act as follows:
86
99
87
-
* Download - creates a .hex file locally in the user's browser and prompts the user to download it. The resulting file should be copied over to the micro:bit device just like when using all the other editors. The filename will be the name of the script with spaces replaced by "_" and ending in .py. So "extraordinary script" is saved as extraordinary_script.py.
100
+
* Download - creates a .hex file locally in the user's browser and prompts the user to download it. The resulting file should be copied over to the micro:bit device just like when using all the other editors. The filename will be the name of the script with spaces replaced by "_" and ending in .hex. So "extraordinary script" is saved as extraordinary_script.hex.
101
+
* Save - download a copy of the Python source code. The filename will be the name of the script with spaces replaced by "_" and ending in .py.
102
+
* Blockly - arrange visual blocks to quickly create Python code. Moving such blocks will re-write your Python code and you may lose work. Furthermore, the arrangement of blocks is currently not saved, just the resulting Python code as described above.
88
103
* Snippets - allow user's to write code from pre-defined Python fragments (functions, loops, if...else etc). They are triggered by typing a keyword followed by TAB. For example, type "wh" followed by TAB to insert a while... loop. Clicking on the code snippets button opens up a modal dialog window containing instructions and a table of the available snippets along with their trigger and a short and simple description.
89
104
* Help - opens a single page in a new tab that contains user-facing help.
90
105
* Share - generate a short URL for the script. Share this with others. This button will be missing if run from the local file system.
91
106
92
-
Directly next to the four large buttons are two smaller icons. The zoom in and
107
+
Directly next to the large buttons are two smaller icons. The zoom in and
93
108
zoom out buttons that make it easy for teachers to display code via a projector.
94
109
110
+
If you have a Python script or hex file on your local computer, you can load it
111
+
into the editor by dragging it onto the text area.
112
+
95
113
If you plug in your micro:bit and want to get the REPL you'll need to install
96
114
pyserial and run the following command with the appropriate permissions (such
97
115
as root, as shockingly demonstrated below)::
@@ -115,6 +133,13 @@ relatively small when you consider:
115
133
* The web has caching built in (we should trust it)
116
134
* We actually want kids to view source and find the .hex file in as raw a form as possible.
117
135
136
+
Configuration
137
+
-------------
138
+
139
+
To launch the editor you'll need to pass in a ``config`` JavaScript object
140
+
containing translation strings and feature flags. Take a look in the
0 commit comments