Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 71064f5

Browse files
committed
Update documentation in light of recent changes.
1 parent be78ffc commit 71064f5

6 files changed

Lines changed: 81 additions & 3 deletions

File tree

‎CHANGELOG‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
0.0.8
2+
-----
3+
4+
* Add blockly support (requires GIT sub-modules).
5+
* Add config object containing translation strings.
6+
* Add feature flags to the config object.
7+
* Check for size of Python script before flashing (added tests for this too).
8+
* Move editor instantiation to within the HTML.
9+
* Updated help to include latest UI changes.
10+
* Updated README in light of changes above.
11+
112
0.0.7
213
-----
314

‎README.rst‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Developer Setup
1111

1212
This editor works with any modern web browser.
1313

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+
1420
Assuming you have Python 3 installed you can serve the editor like this::
1521

1622
$ ./show.sh
@@ -43,14 +49,21 @@ Code
4349
++++
4450

4551
* 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!).
4655
* editor.html - the page to be loaded by your browser.
4756
* firmware.hex - copy of the "vanilla" MicroPython firmware used by the editor.
4857
* 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.
4960
* python-main.js - the JavaScript code for running the editor.
61+
* README.rst - this file, the clue is in the name. ;-)
5062
* tests.html - the browser based test runner.
5163
* show.sh - a script that allows you to serve the editor from localhost. Requires Python 3.
5264
* static - contains css, js and img sub-directories.
5365
* tests - contains the Python specific test suite.
66+
* tests.html - point your browser at this file to run the tests.
5467

5568
Contributing
5669
++++++++++++
@@ -81,17 +94,22 @@ name and comment. Please note that all query string arguments must be correctly
8194
URL encoded - this especially applies to code. Use the "share" button in the
8295
editor to generate and share such URLs with appended query strings.
8396

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
8598
top left, act as follows:
8699

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.
88103
* 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.
89104
* Help - opens a single page in a new tab that contains user-facing help.
90105
* Share - generate a short URL for the script. Share this with others. This button will be missing if run from the local file system.
91106

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
93108
zoom out buttons that make it easy for teachers to display code via a projector.
94109

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+
95113
If you plug in your micro:bit and want to get the REPL you'll need to install
96114
pyserial and run the following command with the appropriate permissions (such
97115
as root, as shockingly demonstrated below)::
@@ -115,6 +133,13 @@ relatively small when you consider:
115133
* The web has caching built in (we should trust it)
116134
* We actually want kids to view source and find the .hex file in as raw a form as possible.
117135

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
141+
``editor.html`` file to see how this is done.
142+
118143
Documentation
119144
-------------
120145

‎help.html‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<ul class="nav navbar-nav">
4747
<li><a href="#top">Start Here</a></li>
4848
<li><a href="#hello">Hello, World!</a></li>
49+
<li><a href="#blockly">Blockly</a></li>
4950
<li><a href="#snippets">Snippets</a></li>
5051
<li><a href="#bugs">Bug Fixes</a></li>
5152
<li><a href="#fun">Fun Stuff</a></li>
@@ -110,6 +111,19 @@ <h2 id="start">Start Here</h2>
110111
code back into the editor.
111112
</td>
112113
</tr>
114+
<tr>
115+
<td>
116+
<img src="static/img/block_button.png" alt="Blockly button"/>
117+
</td>
118+
<td>
119+
Clicking the "Blockly" button displays a set of drag-and-drop
120+
blocks that can be used to quickly create Python code. Move the
121+
blocks, watch Python code appear and change. <strong>Moving such
122+
blocks will re-write your Python code and you may lose work.
123+
Furthermore, the arrangement of blocks is currently not saved,
124+
just the resulting Python code.</strong>
125+
</td>
126+
</tr>
113127
<tr>
114128
<td>
115129
<img src="static/img/snippets.png" alt="Snippets button"/>
@@ -220,6 +234,34 @@ <h2 id="hello">Hello, World!</h2>
220234
BBC micro:bit scroll your name? Remember, MicroPython will scroll
221235
everything between the <code>"</code>quotation marks<code>"</code>.</p>
222236

237+
<h2 id="blockly">Blockly</h2>
238+
239+
<p>Use blockly to make new Python code from easy to assemble blocks of
240+
code.</p>
241+
242+
<p><img src="static/img/blocks.png"
243+
class="img-responsive center-block img-rounded"
244+
alt="An animation demonstrating how to use snippets."/></p>
245+
246+
<p>Blockly updates Python in the code editor as you move blocks around.
247+
There are lots of different blocks to cover all the features of the
248+
micro:bit. You can make more advanced code by combining blocks together
249+
(such as in the example above).</p>
250+
251+
<p>You should use Blockly to create <em>new code</em> since moving blocks
252+
around will overwrite any existing code you have in the editor (and you may
253+
lose work as a result). The arrangement of blocks isn't (currently)
254+
saved, so Blockly makes a great way to make simple Python code without
255+
lots of typing. In the end, you'll learn that simply typing Python is by
256+
far the quickest and easiest way to write code.</p>
257+
258+
<p>Not all the features of the micro:bit or MicroPython are available via
259+
Blockly. We've done this on purpose. Some of the more advanced and
260+
interesting stuff is only available in pure Python.</p>
261+
262+
<p>However, by using Blockly you'll very quickly get the hang of how Python
263+
code works and fits together.</p>
264+
223265
<h2 id="snippets">Snippets</h2>
224266

225267
<p>Snippets are a cool way to avoid typing. The animation below shows you

‎static/img/block_button.png‎

3.88 KB
Loading

‎static/img/blocks.png‎

82.1 KB
Loading

‎static/img/header.png‎

1.56 KB
Loading

0 commit comments

Comments
 (0)