Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add editorconfig for markdown #1136

Open
wants to merge 2 commits into
base: public
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
root = true

[*.md]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
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.