Skip to content

Commit

Permalink
general cleanups in the language pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ganicke committed Feb 27, 2025
1 parent 3f73057 commit 1f371b2
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 17 deletions.
3 changes: 2 additions & 1 deletion common-docs/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
### @description Language constructs for the Block editor.

## #blocksbase
Blocks snap into each other to define the program that your @boardname@ will run.

Blocks snap into each other to define the program that will run.
Blocks can be event (buttons, shake, ...) or need to be snapped into an event to run.
The [on-start](/blocks/on-start) event runs first.

Expand Down
8 changes: 5 additions & 3 deletions common-docs/javascript/call.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Call a function

The simplest way to get started in JavaScript with your @boardname@ is to
call one of the @boardname@'s built-in JavaScript functions. Just like how Blocks
are organized into categories/drawers, the @boardname@ functions are organized by
The simplest way to get started in JavaScript is to
call one of the built-in JavaScript functions. Just like how Blocks
are organized into categories/drawers, the functions are organized by
namespaces, with names corresponding to the drawer names.

```typescript-ignore
Expand All @@ -11,6 +11,8 @@ Math.abs(-1)

### ~ hint

#### Functions in a namespace

If you want to see all functions available in the `Math` namespace, simply type `Math`
followed by `.` and a list of all the functions will appear.

Expand Down
4 changes: 3 additions & 1 deletion common-docs/javascript/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ let sum = add(1, 2);

### ~ hint

For the @boardname@, you must specify a [type](/javascript/types) for each function parameter.
#### Parameter types

You must specify a [type](/javascript/types) for each function parameter.

### ~

Expand Down
2 changes: 1 addition & 1 deletion common-docs/javascript/operators.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Operators

The following JavaScript operators are supported for the @boardname@.
The following JavaScript operators are supported:

## Assignment, arithmetic and bitwise

Expand Down
2 changes: 2 additions & 0 deletions common-docs/javascript/sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ doSomething(); // THIS LINE WILL NEVER EXECUTE!

### ~hint

#### No 'empty' statements

To avoid this problem, we don't allow a program to contain an empty statement, such as shown above.
If you really want an empty statement, you need to use curly braces to delimit an empty statement block:
```typescript-ignore
Expand Down
2 changes: 1 addition & 1 deletion common-docs/javascript/statements.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Statements

The following JavaScript statements are supported for the @boardname@:
The following JavaScript statements are supported:

## Variable declarations
* [`const` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)
Expand Down
10 changes: 6 additions & 4 deletions common-docs/python/call.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Call a function

The simplest way to get started in Python with your @boardname@ is to
call one of the @boardname@'s built-in Python functions. Just like how Blocks
are organized into categories/drawers, the @boardname@ functions are organized by
namespaces, with names corresponding to the drawer names.
The simplest way to get started in Python is to
call one of the built-in Python functions. Just like how Blocks
are organized into categories/drawers, functions are organized by
namespaces too, with names corresponding to the drawer names.

```python-ignore
Math.abs(-1)
```

### ~ hint

#### Functions in a namespace

If you want to see all functions available in the `Math` namespace, simply type `Math`
followed by `.` and a list of all the functions will appear.

Expand Down
6 changes: 3 additions & 3 deletions common-docs/python/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The default value of `lastName` disappears in the type, only leaving behind the
Handler functions are functions that take some action when an event or change of state occurs. Usually, some other code saves, or registers, the handler function in a variable in order to call
it at a later time. When an event happens, like a new input value or an elapsed timer, the handler is called to run a response action.

As an example, the `Thermal` class will check for changes in temperature and run a registered handler when the temperature drops to a set thershold:
As an example, the `Thermal` class will check for changes in temperature and run a registered handler when the temperature drops to a set threshold:

```python-ignore
# the handler function when it's cold...
Expand All @@ -122,9 +122,9 @@ thermal.whenCold(whenCold)
thermal.checkCold()
```

## Lamda Functions
## Lambda Functions

Lamda functions serve as a kind of shortcut to return a result of an expression. A lamda is often saved to a variable and then used like a function to return the expression result:
Lambda functions serve as a kind of shortcut to return a result of an expression. A lambda is often saved to a variable and then used like a function to return the expression result:

```python-ignore
def square(x):
Expand Down
2 changes: 1 addition & 1 deletion common-docs/python/operators.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Operators

The following Python operators are supported for the @boardname@.
The following Python operators are supported:

## Assignment, arithmetic and bitwise

Expand Down
2 changes: 1 addition & 1 deletion common-docs/python/statements.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Statements

The following Python statements are supported for the @boardname@:
The following Python statements are supported:

## Variable declarations

Expand Down
2 changes: 1 addition & 1 deletion common-docs/types.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Types

A *type* refers to a class of data and the operations permitted on that class of data.
The following built-in types are supported for the @boardname@:
The following built-in types are supported:

## Basic (primitive) types #primitives

Expand Down

0 comments on commit 1f371b2

Please sign in to comment.