diff --git a/CHANGELOG b/CHANGELOG index 0450b8a7..c373db48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +1.1.2 +----- + +* Updated MicroPython to 1.0.1 release +* Updated README with migration documentation + 1.1.1 ----- diff --git a/README.rst b/README.rst index 8413ea8c..0ba94ca6 100644 --- a/README.rst +++ b/README.rst @@ -136,6 +136,29 @@ relatively small when you consider: * The web has caching built in (we should trust it) * We actually want kids to view source and find the .hex file in as raw a form as possible. +Importing Projects +++++++++++++++++++ +Python projects from external sources can be imported into the editor using a special URL e.g. +``https://python.microbit.org/v/1.1#project:{{ encoded project }}`` + +To encode a project, it must be structured as follows: + +:: + + { + meta: { + cloudId: "microbit.co.uk", # optional + comment: "A MicroPython script", # required - may be blank + editor: "python", # required - editor name + lastUse: 1538407830, # optional - UNIX time the script was last used + name: "unearthly script 2" # required - may be blank + }, + source: "# Add your Python code here. E.g.\r\n from microbit import *\r\n while True:\r\n display.scroll('Hello, World!')\r\nsleep(2000)" + } + +This JSON structure is compressed using `LZMA +`_, and then encoded as Base64 to include in the import URL. + Configuration ------------- diff --git a/editor.html b/editor.html index b3ce346b..372fb44e 100644 --- a/editor.html +++ b/editor.html @@ -70,8 +70,8 @@