diff --git a/docs/js/classes.md b/docs/js/classes.md index 832eecf0..1cfd47e7 100644 --- a/docs/js/classes.md +++ b/docs/js/classes.md @@ -43,7 +43,7 @@ Of course, one of the most fundamental patterns in class-based programming is be Let's take a look at an example: -```ts +```ts-ignore class Animal { name: string; constructor(theName: string) { this.name = theName; } @@ -105,7 +105,7 @@ In TypeScript, each member is `public` by default. You may still mark a member `public` explicitly. We could have written the `Animal` class from the previous section in the following way: -```ts +```ts-ignore class Animal { public name: string; public constructor(theName: string) { this.name = theName; } @@ -119,7 +119,7 @@ class Animal { When a member is marked `private`, it cannot be accessed from outside of its containing class. For example: -```ts +```ts-ignore class Animal { private name: string; constructor(theName: string) { this.name = theName; } @@ -138,7 +138,7 @@ The same applies to `protected` members. Let's look at an example to better see how this plays out in practice: -```ts +```ts-ignore class Animal { private name: string; constructor(theName: string) { this.name = theName; } @@ -174,7 +174,7 @@ Even though `Employee` also has a `private` member called `name`, it's not the o The `protected` modifier acts much like the `private` modifier with the exception that members declared `protected` can also be accessed by instances of deriving classes. For example, -```ts +```ts-ignore class Person { protected name: string; constructor(name: string) { this.name = name; } @@ -204,7 +204,7 @@ we can still use it from within an instance method of `Employee` because `Employ A constructor may also be marked `protected`. This means that the class cannot be instantiated outside of its containing class, but can be extended. For example, -```ts +```ts-ignore class Person { protected name: string; protected constructor(theName: string) { this.name = theName; } @@ -233,7 +233,7 @@ let john = new Person("John"); // Error: The 'Person' constructor is protected You can make properties readonly by using the `readonly` keyword. Readonly properties must be initialized at their declaration or in the constructor. -```ts +```ts-ignore class Octopus { readonly name: string; readonly numberOfLegs: number = 8; @@ -252,7 +252,7 @@ This turns out to be a very common practice. *Parameter properties* let you create and initialize a member in one place. Here's a further revision of the previous `Octopus` class using a parameter property: -```ts +```ts-ignore class Octopus { readonly numberOfLegs: number = 8; constructor(readonly name: string) { diff --git a/docs/js/functions.md b/docs/js/functions.md index c11d20d7..4c5b26a9 100644 --- a/docs/js/functions.md +++ b/docs/js/functions.md @@ -45,7 +45,7 @@ TypeScript can figure the return type out by looking at the return statements, s In TypeScript, the number of arguments given to a function has to match the number of parameters the function expects. -```ts +```ts-ignore function buildName(firstName: string, lastName: string) { return firstName + " " + lastName; } @@ -60,7 +60,7 @@ When they do, their value is `undefined`. We can get this functionality in TypeScript by adding a `?` to the end of parameters we want to be optional. For example, let's say we want the last name parameter from above to be optional: -```ts +```ts-ignore function buildName(firstName: string, lastName?: string) { if (lastName) return firstName + " " + lastName; @@ -80,7 +80,7 @@ In TypeScript, we can also set a value that a parameter will be assigned if the These are called default-initialized parameters. Let's take the previous example and default the last name to `"Smith"`. -```ts +```ts-ignore function buildName(firstName: string, lastName = "Smith") { return firstName + " " + lastName; } @@ -115,7 +115,7 @@ Unlike plain optional parameters, default-initialized parameters don't *need* to If a default-initialized parameter comes before a required parameter, users need to explicitly pass `undefined` to get the default initialized value. For example, we could write our last example with only a default initializer on `firstName`: -```ts +```ts-ignore function buildName(firstName = "Will", lastName: string) { return firstName + " " + lastName; } @@ -134,7 +134,7 @@ In JavaScript, you can work with the arguments directly using the `arguments` va In TypeScript, you can gather these arguments together into a variable: -```ts +```ts-ignore function buildName(firstName: string, ...restOfName: string[]) { return firstName + " " + restOfName.join(" "); } @@ -148,7 +148,7 @@ The compiler will build an array of the arguments passed in with the name given The ellipsis is also used in the type of the function with rest parameters: -```ts +```ts-ignore function buildName(firstName: string, ...restOfName: string[]) { return firstName + " " + restOfName.join(" "); } diff --git a/docs/js/variables.md b/docs/js/variables.md index 1100d135..344454ae 100644 --- a/docs/js/variables.md +++ b/docs/js/variables.md @@ -44,7 +44,7 @@ Another property of block-scoped variables is that they can't be read or written While these variables are "present" throughout their scope, all points up until their declaration are part of their *temporal dead zone*. This is just a sophisticated way of saying you can't access them before the `let` statement, and luckily TypeScript will let you know that. -```typescript +```typescript-ignore a++; // illegal to use 'a' before it's declared; let a; ``` diff --git a/docs/lessons/charting/challenge.md b/docs/lessons/charting/challenge.md index 18b40846..660a10c0 100644 --- a/docs/lessons/charting/challenge.md +++ b/docs/lessons/charting/challenge.md @@ -86,3 +86,7 @@ Have fun reviewing your simulation and analyze the acceleration by chart the Exc * The first person and second person take turns tilting the micro:bit in the "x" direction while the other player charts the data on the micro:bit! * Review and analyze the actual micro:bit device acceleration data on Excel * Display acceleration with y or z using plot bar graph by changing acceleration from "x" to "y" or "z" + +```package +microbit-radio +``` \ No newline at end of file diff --git a/docs/lessons/pogo.md b/docs/lessons/pogo.md index ddd50a58..928a9612 100644 --- a/docs/lessons/pogo.md +++ b/docs/lessons/pogo.md @@ -42,3 +42,7 @@ radio.onDataReceived(() => { }) * learn how to conditionally run code depending on whether a condition is true or not * learn how to run code when an input button is pressed * learn how to pause your code for the specified number of milliseconds + +```package +microbit-radio +``` \ No newline at end of file diff --git a/docs/lessons/pogo/activity.md b/docs/lessons/pogo/activity.md index d8a3941c..8e85a649 100644 --- a/docs/lessons/pogo/activity.md +++ b/docs/lessons/pogo/activity.md @@ -162,3 +162,7 @@ radio.onDataReceived(() => { Connect the first micro:bit to your computer using your USB cable and run the pogo script on it. Connect the second micro:bit to your computer using your USB cable and run the pogo script on it. The first person and second person take turns jumping in the “y” direction while the other player uses the micro:bit to track the results on the micro:bit! + +```package +microbit-radio +``` \ No newline at end of file diff --git a/docs/lessons/seismograph.md b/docs/lessons/seismograph.md index a5f7b6c5..53a14e38 100644 --- a/docs/lessons/seismograph.md +++ b/docs/lessons/seismograph.md @@ -33,3 +33,7 @@ radio.receiveNumber(); * learn how to return the sum of the two numbers * learn how to get acceleration value in milli-gravitys * learn how to read the connector value as analog as a value comprised between 0 and 1023 + +```package +microbit-radio +``` \ No newline at end of file diff --git a/docs/lessons/seismograph/challenge.md b/docs/lessons/seismograph/challenge.md index 8c8134a0..e046449a 100644 --- a/docs/lessons/seismograph/challenge.md +++ b/docs/lessons/seismograph/challenge.md @@ -195,4 +195,6 @@ Let's select Style 10 as an example. * The first person and second person take shaking or moving the micor:bit in any direction while the other player charts the data on the micro:bit! * Review and analyze the actual micro:bit device acceleration data on Excel - +```package +microbit-radio +``` \ No newline at end of file diff --git a/docs/projects/radio-challenges.md b/docs/projects/radio-challenges.md index 7cdec64c..12f2f331 100644 --- a/docs/projects/radio-challenges.md +++ b/docs/projects/radio-challenges.md @@ -89,4 +89,8 @@ Have fun reviewing your simulation and analyze the acceleration by chart the Exc ### ~button /projects/the-watch NEXT: The Watch -### ~ \ No newline at end of file +### ~ + +```package +microbit-radio +``` \ No newline at end of file diff --git a/docs/reference/images/pixel.md b/docs/reference/images/pixel.md index df103276..f11b8147 100644 --- a/docs/reference/images/pixel.md +++ b/docs/reference/images/pixel.md @@ -41,7 +41,7 @@ let img = images.createImage(` ### ~ -```blocks +```typescript-ignore let state = img.pixel(0, 0) ``` diff --git a/docs/reference/images/width.md b/docs/reference/images/width.md index 9bf90763..31df2f77 100644 --- a/docs/reference/images/width.md +++ b/docs/reference/images/width.md @@ -32,7 +32,7 @@ let img = images.createImage(` ### ~ -```blocks +```typescript-ignore let w = img.width() ``` @@ -40,7 +40,7 @@ let w = img.width() The following example uses the `width` function with a [for](/blocks/loops/for) loop to show each image frame on the screen: -```blocks +```typescript let img2 = images.createImage(` . . # . . . # # # # . # # # . . # # . . . . . . # . . . # .