diff --git a/libs/core/test.ts b/libs/core/test.ts
index 056e7c43..2147a5ba 100644
--- a/libs/core/test.ts
+++ b/libs/core/test.ts
@@ -1,51 +1,36 @@
screen.clear()
-screen.print("PXT!", 10, 30, Draw.Quad)
+brick.print("PXT!", 10, 30, Draw.Quad)
-screen.drawRect(40, 40, 20, 10, Draw.Fill)
-motors.setStatusLight(LightsPattern.Orange)
+brick.drawRect(40, 40, 20, 10, Draw.Fill)
+brick.setStatusLight(LightsPattern.Orange)
-screen.heart.doubled().draw(100, 50, Draw.Double | Draw.Transparent)
+brick.heart.doubled().draw(100, 50, Draw.Double | Draw.Transparent)
-sensors.buttonEnter.onEvent(ButtonEvent.Click, () => {
+brick.buttonEnter.onEvent(ButtonEvent.Click, () => {
screen.clear()
})
-sensors.buttonLeft.onEvent(ButtonEvent.Click, () => {
- screen.drawRect(10, 70, 20, 10, Draw.Fill)
- motors.setStatusLight(LightsPattern.Red)
- screen.setFont(screen.microbitFont())
+brick.buttonLeft.onEvent(ButtonEvent.Click, () => {
+ brick.drawRect(10, 70, 20, 10, Draw.Fill)
+ brick.setStatusLight(LightsPattern.Red)
+ brick.setFont(brick.microbitFont())
})
-sensors.buttonRight.onEvent(ButtonEvent.Click, () => {
- screen.print("Right!", 10, 60)
+brick.buttonRight.onEvent(ButtonEvent.Click, () => {
+ brick.print("Right!", 10, 60)
})
-sensors.buttonDown.onEvent(ButtonEvent.Click, () => {
- screen.print("Down! ", 10, 60)
+brick.buttonDown.onEvent(ButtonEvent.Click, () => {
+ brick.print("Down! ", 10, 60)
})
-sensors.buttonUp.onEvent(ButtonEvent.Click, () => {
- screen.print("Up! ", 10, 60)
+brick.buttonUp.onEvent(ButtonEvent.Click, () => {
+ brick.print("Up! ", 10, 60)
})
let num = 0
-sensors.touchSensor1.onEvent(TouchSensorEvent.Bumped, () => {
- screen.print("Click! " + num, 10, 60)
- num++
-})
-
-sensors.remoteButtonTopLeft.onEvent(ButtonEvent.Click, () => {
- screen.print("TOPLEFT " + num, 10, 60)
- num++
-})
-
-sensors.remoteButtonTopRight.onEvent(ButtonEvent.Down, () => {
- screen.print("TOPRIGH " + num, 10, 60)
- num++
-})
-
loops.forever(() => {
serial.writeDmesg()
loops.pause(100)
diff --git a/package.json b/package.json
index 3fec37d6..0087de27 100644
--- a/package.json
+++ b/package.json
@@ -39,6 +39,7 @@
"semantic-ui-less": "^2.2.4",
"@types/bluebird": "2.0.33",
"@types/jquery": "3.2.16",
+ "@types/marked": "0.3.0",
"@types/node": "8.0.53"
},
"dependencies": {
diff --git a/pxtarget.json b/pxtarget.json
index b9f7d928..1b2c1bf9 100644
--- a/pxtarget.json
+++ b/pxtarget.json
@@ -137,5 +137,6 @@
"monacoColors": {
"editor.background": "#ecf6ff"
}
- }
+ },
+ "ignoreDocsErrors": true
}
diff --git a/sim/instructions.ts b/sim/instructions.ts
deleted file mode 100644
index b0f872a0..00000000
--- a/sim/instructions.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-///
-///
-
-//HACK: allows instructions.html to access pxtblocks without requiring simulator.html to import blocks as well
-if (!(window).pxt) (window).pxt = {};
-import pxtrunner = pxt.runner;
-import pxtdocs = pxt.docs;
-
-namespace pxsim.instructions {
- export function drawInstructions() {
- pxsim.visuals.mkBoardView = (opts: pxsim.visuals.BoardViewOptions): pxsim.visuals.BoardView => {
- return new visuals.EV3BoardSvg({
- runtime: runtime,
- theme: visuals.randomTheme(),
- disableTilt: false,
- wireframe: opts.wireframe,
- });
- }
-
- let getQsVal = parseQueryString();
-
- //project name
- let name = getQsVal("name") || "Untitled";
-
- // board def
- const boardDef = JSON.parse(getQsVal("board")) as pxsim.BoardDefinition;
-
- //parts list
- let parts = (getQsVal("parts") || "").split(" ");
- parts.sort();
-
- // parts definitions
- let partDefinitions = JSON.parse(getQsVal("partdefs") || "{}") as pxsim.Map
-
- //fn args
- let fnArgs = JSON.parse((getQsVal("fnArgs") || "{}"));
-
- //project code
- let tsCode = getQsVal("code");
- let tsPackage = getQsVal("package") || "";
- let codeSpinnerDiv = document.getElementById("proj-code-spinner");
- let codeContainerDiv = document.getElementById("proj-code-container");
- if (tsCode) {
- //we use the docs renderer to decompile the code to blocks and render it
- //TODO: render the blocks code directly
- let md =
- `\`\`\`blocks
-${tsCode}
-\`\`\`
-\`\`\`package
-${tsPackage}
-\`\`\`
-`
-
- pxtdocs.requireMarked = function () { return (window).marked; }
- pxtrunner.renderMarkdownAsync(codeContainerDiv, md)
- .done(function () {
- let codeSvg = $("#proj-code-container svg");
- if (codeSvg.length > 0) {
- //code rendered successfully as blocks
- codeSvg.css("width", "inherit");
- codeSvg.css("height", "inherit");
- //takes the svg out of the wrapper markdown
- codeContainerDiv.innerHTML = "";
- codeContainerDiv.appendChild(codeSvg[0]);
- } else {
- //code failed to convert to blocks, display as typescript instead
- codeContainerDiv.innerText = tsCode;
- }
- $(codeContainerDiv).show();
- $(codeSpinnerDiv).hide();
- });
- }
-
-
- if (name)
- $("#proj-title").text(name);
-
- //init runtime
- if (!pxsim.initCurrentRuntime)
- pxsim.initCurrentRuntime = initRuntimeWithDalBoard;
-
- renderParts({
- name,
- boardDef,
- parts,
- partDefinitions,
- fnArgs
- })
- }
-}
\ No newline at end of file
diff --git a/sim/public/siminstructions.html b/sim/public/siminstructions.html
deleted file mode 100644
index e5fbdd60..00000000
--- a/sim/public/siminstructions.html
+++ /dev/null
@@ -1,201 +0,0 @@
-
-
-
-
-
- Assembly Instructions
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file