Skip to content

Commit

Permalink
let editorconfig massage all .md files #1136
Browse files Browse the repository at this point in the history
  • Loading branch information
mkellner committed Aug 3, 2023
1 parent 2a33ad5 commit b16dc1d
Show file tree
Hide file tree
Showing 101 changed files with 1,239 additions and 1,239 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You are in the wrong place!

Here are some good places to start:

- Check out [Discussions](https://github.com/Moddable-OpenSource/moddable/discussions) to see if other developers are asking the same question.
- Check out [Discussions](https://github.com/Moddable-OpenSource/moddable/discussions) to see if other developers are asking the same question.
- Search through the [Issues already created](https://github.com/Moddable-OpenSource/moddable/issues?q=is%3Aissue+). Maybe your question has come up before.
- Read the [Documentation](https://github.com/Moddable-OpenSource/moddable/tree/public/documentation#moddable-sdk--documentation-overview). There's lots of detailed documentation of a wide range of topics.
- Ask a question in our [chatroom on Gitter](https://gitter.im/embedded-javascript/moddable).
Expand Down
10 changes: 5 additions & 5 deletions contributed/ble/hid-peripheral/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This folder contains a host and mods that demonstrate how to build BLE HID Keyboards and Media Controllers with the Moddable SDK.
This folder contains a host and mods that demonstrate how to build BLE HID Keyboards and Media Controllers with the Moddable SDK.

For a high-level overview, refer to [this blog post](https://blog.moddable.com/blog/ble-keyboards-media/). This document is documentation for using the BLE HID Host to make new keyboard and media controller apps.

Expand All @@ -20,9 +20,9 @@ An HID peripheral must describe its own input capabilities to the BLE central it

The implemented HID Report Descriptor is provided for reference at the end of this document.

## BLE HID Host API
## BLE HID Host API

### Host Events
### Host Events

Three events are available on the BLE HID Host's `application` object and can be triggered by the UI mod to send keystrokes/button presses to a connected BLE Central:

Expand Down Expand Up @@ -130,7 +130,7 @@ Send a quick tap of the `Mute` HID Consumer Device media key to the BLE Central:
application.delegate("doKeyTap", {hidCode: HIDKEYS.MUTE.HID});
```

## HID Report Descriptor
## HID Report Descriptor

Experienced HID developers may want to review the HID Report Descriptor used by the BLE HID Host. The report follows (annotations courtesy of [https://eleccelerator.com/usbdescreqparser/](https://eleccelerator.com/usbdescreqparser/)):

Expand Down Expand Up @@ -187,4 +187,4 @@ Experienced HID developers may want to review the HID Report Descriptor used by
0x09, 0xB9, // Usage (Shuffle)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
```
```
6 changes: 3 additions & 3 deletions contributed/giphy/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ For more information on the implementation, see the blog post [GIPHY Goes to ESP
cd $MODDABLE/contributed/giphy
mcconfig -d -m -p esp32/moddable_two
```

> **Note:** Instead of putting your Wi-Fi network credentials and Giphy API key in the app manifest, you can also specify them in the `mcconfig` command:
>
>
> ```text
> mcconfig -d -m -p esp32/moddable_two ssid="YOUR_SSID_HERE" password="YOUR_PASSWORD_HERE" apiKey="YOUR_API_KEY_HERE"
> ```
> ```
2 changes: 1 addition & 1 deletion contributed/modClock/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

<img src="https://blog.moddable.com/blog/wp-content/uploads/2019/06/clocks-1024x578.png" width=500>

A classic LED style clock built using the Moddable SDK. For more information, see the [Clock Project](https://blog.moddable.com/blog/clock-project/) blog post.
A classic LED style clock built using the Moddable SDK. For more information, see the [Clock Project](https://blog.moddable.com/blog/clock-project/) blog post.
20 changes: 10 additions & 10 deletions contributed/serial/SerialModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The `Serial` constructor takes its configuration information from the **manifest

let serial = new Serial();

<a id="configuration"></a>
<a id="configuration"></a>
### Configuration

Configuration of the serial port is done in the **manifest.json** file.
Expand All @@ -53,15 +53,15 @@ Configuration of the serial port is done in the **manifest.json** file.

<a id="blocking"></a>
## Blocking I/O

A `timeout` can be set for blocking reads. The units are milliseconds:

serial.setTimeout(10000);

> If a read operation is not fulfilled by the timeout, the call will return with a partial read.
#### Reading

You can read a number of bytes:

let str = serial.readBytes(10);
Expand Down Expand Up @@ -101,19 +101,19 @@ You can write strings with an optional starting and ending position:

serial.write("Hello"); // Hello
serial.write("Hello", 3); // llo
serial.write("Hello", 1, 1); // e
serial.write("Hello", 1, 1); // e
serial.write("Hello", -2); // lo

You can write an array buffer with an optional starting and ending position.

let buffer = new ArrayBuffer(6);
let chars = new Uint8Array(buffer);

// fill buffer with "test 1"
chars[0] = 0x74; chars[1] = 0x65;
chars[2] = 0x73; chars[3] = 0x74;
chars[4] = 0x20; chars[5] = 0x31;

serial.write(buffer); // test 1
serial.write(buffer, 4); // test
serial.write(buffer, 1, 3); // est
Expand Down Expand Up @@ -145,8 +145,8 @@ key | default | description
Call `serial.poll` with no dictionary to stop polling.

serial.poll();


<a id="examples"></a>
## Examples

Expand Down
10 changes: 5 additions & 5 deletions contributed/serial/drivers/sim7100/SIM7100.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ key | default | description

### Stopping the SIM7100

You can stop the SIM7100 by calling its `stop` function.
You can stop the SIM7100 by calling its `stop` function.

```js
sim7100.stop()
Expand Down Expand Up @@ -105,7 +105,7 @@ Set an `onGPSEnabled` function to be notified when it is ready for commands. The
sim7100.onGPSEnabled = function(device) {
device.getGPS(); // read GPS once.
}

sim7100.enableGPS();
```

Expand All @@ -117,7 +117,7 @@ To get a GPS reading, set an `onGPSChanged` function to receive the results and
sim7100.onGPSChanged = function(gps) {
trace(`${gps.seq}) lat:${gps.lat} lon:${gps.lon}\n`);
}

sim7100.getGPS();
```

Expand Down Expand Up @@ -152,7 +152,7 @@ To disable GPS, set an optional `onGPSDisabled` function to be notified when it
sim7100.onGPSDisabled = function(device) {
trace("GPS done.\n");
}

sim7100.disableGPS();
```

Expand Down Expand Up @@ -189,4 +189,4 @@ To change the brightness of the LEDs, call `ledBrightness` with a value between
[sim7100gps](examples/sim7100gps) shows asynchronous GPS message reception.

### gpsmap
[gpsmap](examples/gpsmap) uses the SIM7100 to fetch the current GPS latitude and longitude and presents a map-tile on the moddable_zero screen.
[gpsmap](examples/gpsmap) uses the SIM7100 to fetch the current GPS latitude and longitude and presents a map-tile on the moddable_zero screen.
2 changes: 1 addition & 1 deletion contributed/window-display-moddable-one/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

![](https://blog.moddable.com/blog/wp-content/uploads/2020/12/animation-preview-sm.gif)

This example shows a series of eye-catching animations. It's designed to run on Moddable One, but will also run on Moddable Two and other development boards. For more information about the implementation, see the blog post [Animations on a Display Powered by a $1 Wi-Fi Controller](https://blog.moddable.com/blog/animations-on-microcontrollers/).
This example shows a series of eye-catching animations. It's designed to run on Moddable One, but will also run on Moddable Two and other development boards. For more information about the implementation, see the blog post [Animations on a Display Powered by a $1 Wi-Fi Controller](https://blog.moddable.com/blog/animations-on-microcontrollers/).
6 changes: 3 additions & 3 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Want to contribute to the Moddable SDK? Great! We welcome all kinds of contribut

If you find a bug or have trouble using the Moddable SDK, please [open an issue](https://github.com/Moddable-OpenSource/moddable/issues). We'll respond as quickly as practical. By open an issue, other developers will benefit from the answers to your questions.

Before you open an issue, search the repository to see if someone else has already reported it. If they have, please add comments to the existing thread.
Before you open an issue, search the repository to see if someone else has already reported it. If they have, please add comments to the existing thread.

<a id="requesting-features"></a>
## Requesting features

To request a new feature, please [open an issue](https://github.com/Moddable-OpenSource/moddable/issues).

Before you open an issue, search the repository to see if someone else has already requested the feature. If they have, please add comments to the existing thread about why you'd like to see the feature added.
Before you open an issue, search the repository to see if someone else has already requested the feature. If they have, please add comments to the existing thread about why you'd like to see the feature added.

<a id="pull-requests"></a>
## Submitting pull requests
Expand All @@ -37,4 +37,4 @@ Before we can accept pull requests, we ask that you complete a Contributor Licen

We'd love to see what you make with the Moddable SDK! Please share with us on Twitter [@moddabletech](https://www.twitter.com/moddabletech) or our [chatroom on Gitter](https://gitter.im/embedded-javascript/moddable).

We'd also love to help share your work. The [`contributed` directory](./contributed) of this repository contains community-contributed modules and code. Feel free to submit a pull request to add your projects to this directory.
We'd also love to help share your work. The [`contributed` directory](./contributed) of this repository contains community-contributed modules and code. Feel free to submit a pull request to add your projects to this directory.
14 changes: 7 additions & 7 deletions documentation/base/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The callback function receives the timer id as the first argument.

### `Timer.repeat(callback, interval)`

A repeating timer is called continuously until stopped using the `Timer.clear` function.
A repeating timer is called continuously until stopped using the `Timer.clear` function.

```js
Timer.repeat(id => trace("repeat fired\n"), 1000);
Expand Down Expand Up @@ -165,7 +165,7 @@ const stop = Time.ticks;
trace(`Operation took ${Time.delta(start, stop)} milliseconds\n`);
```

On devices that supports multiple concurrent JavaScript virtual machines (for example, using Workers), the clock used to determine the value of the `ticks` property is the same across all virtual machines. This allows `tick` values created in one machine to be compared with values from another.
On devices that supports multiple concurrent JavaScript virtual machines (for example, using Workers), the clock used to determine the value of the `ticks` property is the same across all virtual machines. This allows `tick` values created in one machine to be compared with values from another.

The range of the value depends on the host. On most microcontrollers, the value is a signed 32-bit integer. On the simulator, it is a positive 64-bit floating point value. To determine the difference between two `ticks` values, use `Time.delta()` which is guaranteed to give a correct result for the host.

Expand Down Expand Up @@ -241,7 +241,7 @@ Debug.gc(false); // disable garbage collector

- **Source code:** [uuid](../../modules/base/uuid)

The `UUID` class provides a single function to generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) string.
The `UUID` class provides a single function to generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) string.

```js
import UUID from "uuid";
Expand All @@ -265,7 +265,7 @@ let value = UUID(); // 1080B49C-59FC-4A32-A38B-DE7E80117842
- **Source code:** [deepEqual](../../modules/base/deepEqual)
- **Tests:** [deepEqual](../../tests/modules/base/deepEqual)

The `deepEqual` function implements a deep comparison between two JavaScript object.
The `deepEqual` function implements a deep comparison between two JavaScript object.

```js
import deepEqual from "deepEqual";
Expand Down Expand Up @@ -296,13 +296,13 @@ The known differences between the Moddable SDK implementation and Node.js will n
- **Source code:** [structuredClone](../../modules/base/structuredClone)
- **Tests:** [structuredClone](../../tests/modules/base/structuredClone)

The `structuredClone` function creates a deep copy of a JavaScript object.
The `structuredClone` function creates a deep copy of a JavaScript object.

```js
import structuredClone from "structuredClone";
```

The `structuredClone` function in the Moddable SDK implements the [algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) defined by WHATWG for the web platform as much as practical, including circular references and the `transferables` option.
The `structuredClone` function in the Moddable SDK implements the [algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) defined by WHATWG for the web platform as much as practical, including circular references and the `transferables` option.

```js
const a = {a: 1, b: Uint8Array.of(1, 2, 3,)}
Expand Down Expand Up @@ -361,7 +361,7 @@ for (let i = 1; true; i++) {

### Instrumentation items

The table below describes the instrumented items that are available. The following instrumented items are reset at one second intervals: Pixels Drawn, Frames Drawn, Poco Display List Used, Piu Command List Used, Network Bytes Read, Network Bytes Written, and Garbage Collection Count.
The table below describes the instrumented items that are available. The following instrumented items are reset at one second intervals: Pixels Drawn, Frames Drawn, Poco Display List Used, Piu Command List Used, Network Bytes Read, Network Bytes Written, and Garbage Collection Count.

| Name | Long Description |
| ---: | :--- |
Expand Down
2 changes: 1 addition & 1 deletion documentation/base/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To minimize RAM use and speed start-up time, the main module and any setup modul

## Additional notes

- The idea for setup modules is loosely modeled on the setup function in the Arduino application model.
- The idea for setup modules is loosely modeled on the setup function in the Arduino application model.
- The simulator implicitly performs the work of setup already, initializing the screen global variable before running the main module.
- The setup modules are only run on the first (main) virtual machine instantiated. For example, when using Workers, the setup modules are not run in the workers.
- Sometimes it is useful to remove a setup module provided by the host, for example to replace the default `setup/network` module so that the application script can manage the Wi-Fi connection itself. This is accomplished using the `"~"` option of manifests.
Expand Down
10 changes: 5 additions & 5 deletions documentation/base/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Scripts import the `Worker` class to be able to create a new worker.
To launch a worker, create an instance of the `Worker` class, passing the name of the module to invoke when the worker starts to run. In the following example, the module run at worker start is `simpleworker`.

let aWorker = new Worker("simpleworker");

The call to the `Worker` constructor returns only after execution of the specified module completes. If the worker module generates an exception during this step, an exception is propagated so that the call to `new Worker` throws an exception. This behavior means that the invoking virtual machine blocks until the new worker virtual machine has completed initialization. Consequently, any operations performed in a newly instantiated virtual machine should be relatively brief.

### Launching a worker with memory configuration
Expand All @@ -39,7 +39,7 @@ The previous example launches the worker with the default memory configuration.
{allocation: 8192, stackCount: 64, slotCount: 64});

### Sending a message to a worker
Messages to workers are JavaScript objects and binary data.
Messages to workers are JavaScript objects and binary data.

aWorker.postMessage({hello: "world", count: 12});
aWorker.postMessage(new ArrayBuffer(12));
Expand Down Expand Up @@ -77,7 +77,7 @@ When the Worker constructor is called, the module at the path specified (`simple

let count = 1;
let state = INITIALIZED;

self.onmessage = function (message) {
trace(message, "\n");
}
Expand Down Expand Up @@ -123,7 +123,7 @@ The `postMessage` function queues a message for delivery to the worker. Messages

Messages are delivered in the same order they are sent.

Messages are passed by copy (with a few exceptions, such as `SharedArrayBuffer`, so the size of the message should be as small as practical. If the memory allocation fails, `postMessage` throws an exception.
Messages are passed by copy (with a few exceptions, such as `SharedArrayBuffer`, so the size of the message should be as small as practical. If the memory allocation fails, `postMessage` throws an exception.

#### onmessage property
The worker `onmessage` property contains a function which receives messages from the worker.
Expand All @@ -143,7 +143,7 @@ The `SharedWorker` class is an API for working with shared virtual machines. The
Scripts import the `SharedWorker` class to be able to connect to a shared worker, creating the shared worker if it is not currently instantiated.

import {SharedWorker} from "worker";

**Note**: Examples and documentation needed.

## Scheduling
Expand Down

0 comments on commit b16dc1d

Please sign in to comment.