From b9bf9294590bd7c37c00b8a155ddf6cbe640c00f Mon Sep 17 00:00:00 2001 From: Tim_Tech_Dev Date: Sat, 16 Oct 2021 10:30:27 +0200 Subject: [PATCH 1/3] Add Prettier config for indent Signed-off-by: Tim_Tech_Dev --- .ignore-files.txt | 2 ++ .markdownlint.json | 8 ++++++-- package.json | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .ignore-files.txt diff --git a/.ignore-files.txt b/.ignore-files.txt new file mode 100644 index 00000000..0518c836 --- /dev/null +++ b/.ignore-files.txt @@ -0,0 +1,2 @@ +docs/dependencies.md +docs/services.md diff --git a/.markdownlint.json b/.markdownlint.json index c8e5e5e5..14085405 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,7 +1,11 @@ { "default": true, "MD003": { "style": "atx" }, - "MD007": { "indent": 4 }, + "ul-indent": { "indent": 4 }, + "list-marker-space": { + "ul_single": 3, + "ul_multi": 3 + }, "MD012": false, "MD013": false, "MD026": false, @@ -11,7 +15,7 @@ "MD040": false, "MD041": false, "MD046": false, - "MD047": false, + "MD047": true, "no-hard-tabs": true, "whitespace": false } diff --git a/package.json b/package.json index 60f8f9a2..e8cebc29 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,9 @@ "private": true, "nodecg": { "compatibleRange": "^1.1.1" + }, + "scripts": { + "lint": "markdownlint -p ./.ignore-files.txt .", + "format": "prettier -w --ignore-path ./.ignore-files.txt **.md" } } From c13f3ab315839ec36e47bbe891929e89bb773142 Mon Sep 17 00:00:00 2001 From: Tim_Tech_Dev Date: Sun, 17 Oct 2021 18:34:10 +0200 Subject: [PATCH 2/3] Format documents Signed-off-by: Tim_Tech_Dev --- docs/contribute/contribute.md | 2 +- docs/contribute/create_sample.md | 9 +-- docs/contribute/create_service.md | 4 +- docs/getting_started/configuration.md | 14 ++-- docs/getting_started/create_new_bundle.md | 8 +-- docs/getting_started/existing_bundle.md | 2 +- docs/getting_started/install.md | 11 ++-- docs/index.md | 80 ++++++++++++----------- docs/samples/android.md | 10 +-- docs/samples/artnet.md | 3 +- docs/samples/curseforge.md | 8 +-- docs/samples/dbus-ratbagd.md | 10 +-- docs/samples/debug.md | 8 +-- docs/samples/discord-rpc.md | 10 +-- docs/samples/github.md | 10 +-- docs/samples/gsheets.md | 2 +- docs/samples/midi-input.md | 6 +- docs/samples/midi-io.md | 8 +-- docs/samples/midi-output.md | 8 +-- docs/samples/rcon.md | 2 +- docs/samples/serial.md | 12 ++-- docs/samples/spotify.md | 6 +- docs/samples/sql.md | 2 +- docs/samples/tiane.md | 11 ++-- docs/samples/twitch-addons.md | 10 +-- docs/samples/youtube.md | 2 +- 26 files changed, 126 insertions(+), 132 deletions(-) diff --git a/docs/contribute/contribute.md b/docs/contribute/contribute.md index 0fe93aec..8a264c05 100644 --- a/docs/contribute/contribute.md +++ b/docs/contribute/contribute.md @@ -48,7 +48,7 @@ cd path/to/nodecg-io npm run watch ``` -_Note:_ Watching all packages requires a lot of RAM. +_Note:_ Watching all packages requires a lot of RAM. Instead, you can watch just the packages you are actively working on e.g., `npm run watch -- --scope nodecg-io-twitch-chat --scope twitch-chat`. This will just spawn a watch process for the twitch-chat sample and service and require way less memory. diff --git a/docs/contribute/create_sample.md b/docs/contribute/create_sample.md index 59d15b1d..58976a3b 100644 --- a/docs/contribute/create_sample.md +++ b/docs/contribute/create_sample.md @@ -48,19 +48,14 @@ import { TheServicesExportedClient } from "nodecg-io-"; module.exports = function (nodecg: NodeCG) { nodecg.log.info("Sample bundle for started"); - const service = requireService( - nodecg, - "" - ); + const service = requireService(nodecg, ""); service?.onAvailable((client) => { nodecg.log.info(" client has been updated."); // TODO do something with the client to demonstrate the functionality. }); - service?.onUnavailable(() => - nodecg.log.info(" client has been unset.") - ); + service?.onUnavailable(() => nodecg.log.info(" client has been unset.")); }; ``` diff --git a/docs/contribute/create_service.md b/docs/contribute/create_service.md index 22637275..9c771555 100644 --- a/docs/contribute/create_service.md +++ b/docs/contribute/create_service.md @@ -87,7 +87,7 @@ Create a file called `index.ts` in a folder called `extension` inside your servi // TODO: Rename all occurrences of "your-service-name" with only lowercase and hyphens ( - ) import { NodeCG } from "nodecg-types/types/server"; -import { Result,emptySuccess,success,ServiceBundle } from "nodecg-io-core"; +import { Result, emptySuccess, success, ServiceBundle } from "nodecg-io-core"; // TODO: Replace the "fake" service class with that found on npm etc. import { ServiceClass } from "./"; @@ -108,7 +108,7 @@ module.exports = (nodecg: NodeCG) => { new YourServiceNameService(nodecg, "your-service-name", __dirname, "../your-service-name-schema.json").register(); }; -class YourServiceNameService extends ServiceBundle { +class YourServiceNameService extends ServiceBundle { async validateConfig(config: YourServiceNameServiceConfig): Promise> { // TODO You can validate your config here. If this gets called, the schema is correct. // You should for example check whether oauth keys are valid and servers are online here diff --git a/docs/getting_started/configuration.md b/docs/getting_started/configuration.md index fefee02f..56441a36 100644 --- a/docs/getting_started/configuration.md +++ b/docs/getting_started/configuration.md @@ -17,16 +17,16 @@ Any program that can read disk contents can access your credentials of any servi Options of automatic login: -- `enabled` (boolean) +- `enabled` (boolean) - Automatic login will be only enabled if this `enabled` option is set to `true`. - This option can be used to temporarily disable automatic login without needing to delete the whole automatic login configuration - and allows for easy re-enabling without needing to enter the password in the config again. + Automatic login will be only enabled if this `enabled` option is set to `true`. + This option can be used to temporarily disable automatic login without needing to delete the whole automatic login configuration + and allows for easy re-enabling without needing to enter the password in the config again. -- `password` (string) +- `password` (string) - This is the password that will be used to log in. It should be the password you use to log in to nodecg-io. - If this password is wrong an error will be logged after startup. + This is the password that will be used to log in. It should be the password you use to log in to nodecg-io. + If this password is wrong an error will be logged after startup. Example config: diff --git a/docs/getting_started/create_new_bundle.md b/docs/getting_started/create_new_bundle.md index 59dad2fd..212cd15c 100644 --- a/docs/getting_started/create_new_bundle.md +++ b/docs/getting_started/create_new_bundle.md @@ -34,10 +34,10 @@ _Note:_ If you need to access another service inside the callback of a `onAvaila A couple of steps you may want to do after generating a bundle: -- Create a git repository for you bundle (a `.gitignore` is automatically generated for you) and push it to a git platform of your choice -- Add an [open source licence](https://choosealicense.com), don't forget it to also add it to the `package.json` file -- Add code formatters and linting tools like [prettier](https://prettier.io/) and [ESLint](https://eslint.org/) -- Add a README that explains what your bundle does and how it can be used +- Create a git repository for you bundle (a `.gitignore` is automatically generated for you) and push it to a git platform of your choice +- Add an [open source licence](https://choosealicense.com), don't forget it to also add it to the `package.json` file +- Add code formatters and linting tools like [prettier](https://prettier.io/) and [ESLint](https://eslint.org/) +- Add a README that explains what your bundle does and how it can be used ## Share it! diff --git a/docs/getting_started/existing_bundle.md b/docs/getting_started/existing_bundle.md index 4b718d9a..93a6c31d 100644 --- a/docs/getting_started/existing_bundle.md +++ b/docs/getting_started/existing_bundle.md @@ -80,7 +80,7 @@ Handlers added with `onAvailable` will get called if there was a change and you ```typescript // This is the variable with the return value of requireService(). // You may want to change the variable name for the service you are using. -twitchChat.onAvailable(client => { +twitchChat.onAvailable((client) => { nodecg.log.info("Client was set"); // You can use the passed client in here to e.g. setup handlers on the client }); diff --git a/docs/getting_started/install.md b/docs/getting_started/install.md index 90c4884a..47004859 100644 --- a/docs/getting_started/install.md +++ b/docs/getting_started/install.md @@ -24,7 +24,7 @@ Here's how to install the native build tools on the most popular operating syste #### Windows For Windows, you'll need the Visual Studio Build Tools, if you have Visual Studio installed you should already have them. -If you don't have Visual Studio just install the Visual Studio Build Tools by running the following command as an __Administrator__: +If you don't have Visual Studio just install the Visual Studio Build Tools by running the following command as an **Administrator**: ```shell npm install -g windows-build-tools @@ -58,7 +58,6 @@ npm install -g nodecg-io-cli _Note:_ If you are running on Linux, you may need to use `sudo` if your npm installation uses a non-writeable path (default on Ubuntu apt packages, usually does not apply to packages installed using [nvm](https://github.com/nvm-sh/nvm)) - ## Install nodecg-io using the nodecg-io CLI With the nodecg-io CLI installed you can run this command inside a nodecg installation to install nodecg-io: @@ -67,11 +66,11 @@ With the nodecg-io CLI installed you can run this command inside a nodecg instal nodecg-io install ``` -You will get a prompt which asks you which version you want to install. +You will get a prompt which asks you which version you want to install. -- By selecting an actual version (e.g., `0.1`) you create a production install that downloads the required packages from npm and setups a npm workspace to install all dependencies. Here you can choose which services you want to install. +- By selecting an actual version (e.g., `0.1`) you create a production install that downloads the required packages from npm and setups a npm workspace to install all dependencies. Here you can choose which services you want to install. -- By selecting `development` you create a development install that clones the nodecg-io git repo and builds everything from scratch. We only recommend a dev install if you are sure that you want to contribute to nodecg-io. Here you always must install all services. +- By selecting `development` you create a development install that clones the nodecg-io git repo and builds everything from scratch. We only recommend a dev install if you are sure that you want to contribute to nodecg-io. Here you always must install all services. For starters, we recommend using the latest non-development version. @@ -93,4 +92,4 @@ If you want to uninstall nodecg-io you can run the following command: nodecg-io uninstall ``` -This will remove the `nodecg-io` directory inside your nodecg installation and also will remove it from the loaded bundle paths in your nodecg configuration. \ No newline at end of file +This will remove the `nodecg-io` directory inside your nodecg installation and also will remove it from the loaded bundle paths in your nodecg configuration. diff --git a/docs/index.md b/docs/index.md index 25305523..0733d280 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,9 @@ [![Feature Requests](https://img.shields.io/github/issues/codeoverflow-org/nodecg-io/enhancement?label=Feature%20Requests&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/labels/enhancement) [![Bugs](https://img.shields.io/github/issues/codeoverflow-org/nodecg-io/bug?label=Bugs&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/labels/bug) [![Pull Requests](https://img.shields.io/github/issues-pr/codeoverflow-org/nodecg-io?label=Pull%20Requests&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/pulls) + + [![Services](https://img.shields.io/static/v1?label=Services%20implemented&message=41&color=blue&style=flat-square)](services.md) [![License](https://img.shields.io/github/license/codeoverflow-org/nodecg-io?label=License&style=flat-square)](https://github.com/codeoverflow-org/nodecg-io/blob/master/LICENSE) [![Discord](https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&style=flat-square)](https://discord.gg/sX2Gjbs/) @@ -24,45 +26,45 @@ If that's no problem you can head over to the [installation guide](./getting_sta ## Implemented Services and Interfaces -- AutoHotkey -- Android (using adb) -- Art-Net -- CurseForge -- DBus -- Discord -- Discord RPC -- Elgato lights -- GitHub -- Google APIs -- IntelliJ IDEs -- IRC (Internet Relay Chat) -- MIDI Input -- MIDI Output -- MQTT -- Nanoleafs -- OBS -- Philips Hue -- RCON -- Reddit -- sACN Receiver -- sACN Sender -- Serial Port (Arduino) -- [Shlink](https://shlink.io/) -- Slack Web API -- Spotify -- SQL (using [knex](https://knexjs.org/)) -- Elgato Stream Deck -- StreamElements -- Telegram -- TIANE -- Twitch Add-ons -- Twitch API -- Twitch Chat -- Twitch PubSub -- Twitter -- WebSocket Client -- WebSocket Server -- Xdotool +- AutoHotkey +- Android (using adb) +- Art-Net +- CurseForge +- DBus +- Discord +- Discord RPC +- Elgato lights +- GitHub +- Google APIs +- IntelliJ IDEs +- IRC (Internet Relay Chat) +- MIDI Input +- MIDI Output +- MQTT +- Nanoleafs +- OBS +- Philips Hue +- RCON +- Reddit +- sACN Receiver +- sACN Sender +- Serial Port (Arduino) +- [Shlink](https://shlink.io/) +- Slack Web API +- Spotify +- SQL (using [knex](https://knexjs.org/)) +- Elgato Stream Deck +- StreamElements +- Telegram +- TIANE +- Twitch Add-ons +- Twitch API +- Twitch Chat +- Twitch PubSub +- Twitter +- WebSocket Client +- WebSocket Server +- Xdotool ## How to contribute diff --git a/docs/samples/android.md b/docs/samples/android.md index 3f7e2a4a..583366e3 100644 --- a/docs/samples/android.md +++ b/docs/samples/android.md @@ -20,11 +20,11 @@ The Android example bundle in `samples/android` shows how to connect to an andro 9. Run `adb device -l`. The output might look like this: - ``` - ######## device usb:2-1.7 product:######## model:######## device:######## transport_id:2 - ``` - - The hexadecimal number in the first column is your device ID. You'll need this later. + ``` + ######## device usb:2-1.7 product:######## model:######## device:######## transport_id:2 + ``` + + The hexadecimal number in the first column is your device ID. You'll need this later. 10. Start nodecg with nodecg-io installed. The bundle is currently part of it, so it should also be loaded. diff --git a/docs/samples/artnet.md b/docs/samples/artnet.md index 9a4cd16f..8c628183 100644 --- a/docs/samples/artnet.md +++ b/docs/samples/artnet.md @@ -80,7 +80,8 @@ declare class ArtDmx { // send new data every 0,8 seconds. // This is the official timing for re-transmiting data in the artnet specifciation. setInterval(() => { - client.send(universe, + client.send( + universe, values // number[] of values for each of the 512 channels ); }, 800); diff --git a/docs/samples/curseforge.md b/docs/samples/curseforge.md index 7d8f4a07..c28822d0 100644 --- a/docs/samples/curseforge.md +++ b/docs/samples/curseforge.md @@ -4,13 +4,13 @@ The CurseForge example bundle in `samples/curseforge` demonstrates the ability t ### Prerequisites -- Working NodeCG & nodecg-io installation +- Working NodeCG & nodecg-io installation ### Configure the CurseForge bundle 1. Start NodeCG with nodecg-io installed. The CurseForge bundle is currently part of it, so it should also be loaded. 2. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials. 3. Create a new CurseForge service instance using the left upper menu. -4. Set the CurseForge service instance to the service dependency of the CurseForge bundle. - Select the CurseForge bundle and the CurseForge service in the left bottom menu and then select the service instance that should be used by the CurseForge bundle (in this case the name of the previously created CurseForge instance). -5. Check the NodeCG logs. You should see two lists of add-ons. \ No newline at end of file +4. Set the CurseForge service instance to the service dependency of the CurseForge bundle. + Select the CurseForge bundle and the CurseForge service in the left bottom menu and then select the service instance that should be used by the CurseForge bundle (in this case the name of the previously created CurseForge instance). +5. Check the NodeCG logs. You should see two lists of add-ons. diff --git a/docs/samples/dbus-ratbagd.md b/docs/samples/dbus-ratbagd.md index 5ed0572f..f1691ea5 100644 --- a/docs/samples/dbus-ratbagd.md +++ b/docs/samples/dbus-ratbagd.md @@ -19,20 +19,20 @@ The dbus-ratbagd example bundle in `samples/dbus-ratbagd` demonstrates how to ac 5. Configure the dbus service - There should not be any additional configuration needed for the dbus service. Just enter an empty json object like this: + There should not be any additional configuration needed for the dbus service. Just enter an empty json object like this: ```json {} ``` - After entering it, click save. + After entering it, click save. - _Note:_ If you don't see monaco on the right, try reloading the page. + _Note:_ If you don't see monaco on the right, try reloading the page. 6. Set the created dbus service instance to the service dependency of the dbus-ratbagd bundle. - Select the dbus-ratbagd bundle and the dbus service in the left bottom menu and then select the service instance that should be used by the dbus-ratbagd sample bundle (in this case the name of the previously created dbus instance). + Select the dbus-ratbagd bundle and the dbus service in the left bottom menu and then select the service instance that should be used by the dbus-ratbagd sample bundle (in this case the name of the previously created dbus instance). 7. Check the nodecg logs - You should see an error or a success message and a list of connected device names + You should see an error or a success message and a list of connected device names diff --git a/docs/samples/debug.md b/docs/samples/debug.md index 358b407d..adb1f844 100644 --- a/docs/samples/debug.md +++ b/docs/samples/debug.md @@ -4,14 +4,14 @@ The Debug Helper example bundle in `samples/debug` demonstrates the ability to u ### Prerequisites -- Working NodeCG & nodecg-io installation +- Working NodeCG & nodecg-io installation ### Configure the Debug sample bundle 1. Start NodeCG with nodecg-io installed. The Debug sample bundle is currently part of it, so it should also be loaded. 2. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials. 3. Create a new Debug service instance using the left upper menu. -4. Set the Debug service instance to the service dependency of the Debug sample bundle. - Select the Debug sample bundle and the Debug service in the left bottom menu and then select the service instance that should be used by the Debug sample bundle (in this case the name of the previously created Debug instance). +4. Set the Debug service instance to the service dependency of the Debug sample bundle. + Select the Debug sample bundle and the Debug service in the left bottom menu and then select the service instance that should be used by the Debug sample bundle (in this case the name of the previously created Debug instance). 5. Go to the nodecg-io-debug dashboard and use some buttons or other inputs. -6. Check the nodecg log. It should contain a message for each action you did and the passed values. \ No newline at end of file +6. Check the nodecg log. It should contain a message for each action you did and the passed values. diff --git a/docs/samples/discord-rpc.md b/docs/samples/discord-rpc.md index ef8a1a89..3beaae24 100644 --- a/docs/samples/discord-rpc.md +++ b/docs/samples/discord-rpc.md @@ -21,7 +21,7 @@ _Note:_ If you don't have an application yet, you can create one [here](https:// 5. Enter required information. - The created instance should be automatically selected, if not select it in the upper left menu. Enter your information in monaco (the text-editor on the right) in this format: + The created instance should be automatically selected, if not select it in the upper left menu. Enter your information in monaco (the text-editor on the right) in this format: ```json { @@ -30,14 +30,14 @@ _Note:_ If you don't have an application yet, you can create one [here](https:// } ``` - After entering it, click save. + After entering it, click save. - _Note:_ If you don't see monaco on the right, try reloading the page. + _Note:_ If you don't see monaco on the right, try reloading the page. 6. Set the created discord-rpc service instance to the service dependency of the discord-rpc bundle. - Select the discord-rpc bundle and the discord-rpc service in the left bottom menu and then select the service instance that should be used by the discord-rpc sample bundle (in this case the name of the previously created discord-rpc instance). + Select the discord-rpc bundle and the discord-rpc service in the left bottom menu and then select the service instance that should be used by the discord-rpc sample bundle (in this case the name of the previously created discord-rpc instance). 7. Check the nodecg logs - You should see an error or a success message displaying your discord username. + You should see an error or a success message displaying your discord username. diff --git a/docs/samples/github.md b/docs/samples/github.md index d9660aee..9af59120 100644 --- a/docs/samples/github.md +++ b/docs/samples/github.md @@ -21,7 +21,7 @@ _Note:_ If you don't have a token yet, you can create one [here](https://github. 5. Enter the GitHub token. - The created instance should be automatically selected, if not select it in the upper left menu. Enter your GitHub token in monaco (the text-editor on the right) in this format: + The created instance should be automatically selected, if not select it in the upper left menu. Enter your GitHub token in monaco (the text-editor on the right) in this format: ```json { @@ -29,14 +29,14 @@ _Note:_ If you don't have a token yet, you can create one [here](https://github. } ``` - After entering it, click save. + After entering it, click save. - _Note:_ If you don't see monaco on the right, try reloading the page. + _Note:_ If you don't see monaco on the right, try reloading the page. 6. Set the created GitHub service instance to the service dependency of the GitHub bundle. - Select the GitHub bundle and the GitHub service in the left bottom menu and then select the service instance that should be used by the GitHub sample bundle (in this case the name of the previously created GitHub instance). + Select the GitHub bundle and the GitHub service in the left bottom menu and then select the service instance that should be used by the GitHub sample bundle (in this case the name of the previously created GitHub instance). 7. Check the nodecg logs - You should see an error or a success message and a list of all your repositories. + You should see an error or a success message and a list of all your repositories. diff --git a/docs/samples/gsheets.md b/docs/samples/gsheets.md index 4c711629..9311dc3f 100644 --- a/docs/samples/gsheets.md +++ b/docs/samples/gsheets.md @@ -7,7 +7,7 @@ The gsheets bundle in `samples/gsheets` demonstrates the ability of retrieving a - Working NodeCG & nodecg-io installation - Google cloud API OAuth access (client ID, client Secret) - Grant `Google Sheets API v4` access at the project's dashboard. - - Shortcut URL: + - Shortcut URL: > _Note:_ If you don't have such a key yet, you can generate them like [this](https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred). As the redirect URI add . diff --git a/docs/samples/midi-input.md b/docs/samples/midi-input.md index 48d08797..d7dbe306 100644 --- a/docs/samples/midi-input.md +++ b/docs/samples/midi-input.md @@ -1,6 +1,6 @@ ## Using the midi-input sample bundle -The midi-input example bundle in `samples/midi-input` demonstrates the ability to read data from a midi device. +The midi-input example bundle in `samples/midi-input` demonstrates the ability to read data from a midi device. ### Prerequisites @@ -28,9 +28,9 @@ The midi-input example bundle in `samples/midi-input` demonstrates the ability t ``` After entering it, click save. - __Note:__ A script is provided to list all inputs and outputs. It can be run from the sample directory `samples/midi-input` using the command `npm run list`. The devices should be listed with their device names and some other stuff. + **Note:** A script is provided to list all inputs and outputs. It can be run from the sample directory `samples/midi-input` using the command `npm run list`. The devices should be listed with their device names and some other stuff. Under Linux this looks for example like this: - + ``` nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0 ``` diff --git a/docs/samples/midi-io.md b/docs/samples/midi-io.md index 2aceaef6..e2cde5b9 100644 --- a/docs/samples/midi-io.md +++ b/docs/samples/midi-io.md @@ -1,6 +1,6 @@ ## Using the midi-io sample bundle -The midi-io example bundle in `samples/midi-io` demonstrates the ability to send/receive data to/from a midi device. +The midi-io example bundle in `samples/midi-io` demonstrates the ability to send/receive data to/from a midi device. ### Prerequisites @@ -28,9 +28,9 @@ The midi-io example bundle in `samples/midi-io` demonstrates the ability to send ``` After entering it, click save. - __Note:__ A script is provided to list all inputs and outputs. It can be run from the sample directory `samples/midi-io` using the command `npm run list`. The devices should be listed with their device names and some other stuff. + **Note:** A script is provided to list all inputs and outputs. It can be run from the sample directory `samples/midi-io` using the command `npm run list`. The devices should be listed with their device names and some other stuff. Under Linux this looks for example like this: - + ``` nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0 ``` @@ -56,4 +56,4 @@ The midi-io example bundle in `samples/midi-io` demonstrates the ability to send ### Note A `Noteon` message with a velocity of 0 should be handled like a `Noteoff` message, so they are echoed unmodified. Otherwise, this would get annoying very fast. -If a control change is assigned to the push-button values of 64 and up are interpreted as on and values lower than that are interpreted as off. Most somewhat modern Midi devices send 127 as on and 0 as off, but 63 and 64 should also be sufficient. \ No newline at end of file +If a control change is assigned to the push-button values of 64 and up are interpreted as on and values lower than that are interpreted as off. Most somewhat modern Midi devices send 127 as on and 0 as off, but 63 and 64 should also be sufficient. diff --git a/docs/samples/midi-output.md b/docs/samples/midi-output.md index 7005f697..b7fb2490 100644 --- a/docs/samples/midi-output.md +++ b/docs/samples/midi-output.md @@ -1,6 +1,6 @@ ## Using the midi-output sample bundle -The midi-output example bundle in `samples/midi-output` demonstrates the ability to send data to a midi device. +The midi-output example bundle in `samples/midi-output` demonstrates the ability to send data to a midi device. ### Prerequisites @@ -28,9 +28,9 @@ The midi-output example bundle in `samples/midi-output` demonstrates the ability ``` After entering it, click save. - __Note:__ A script is provided to list all inputs and outputs. It can be run from the sample directory `samples/midi-output` using the command `npm run list`. The devices should be listed with their device names and some other stuff. + **Note:** A script is provided to list all inputs and outputs. It can be run from the sample directory `samples/midi-output` using the command `npm run list`. The devices should be listed with their device names and some other stuff. Under Linux this looks for example like this: - + ``` nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0 ``` @@ -47,4 +47,4 @@ The midi-output example bundle in `samples/midi-output` demonstrates the ability ### Note -Only sending `Noteon` messages is sufficient for most midi, because most of them don't really care if you use proper `Noteoff` messages or simply send a `Noteon` with a velocity of 0. This is due to the early days of midi, when integrated circuits were expensive. Allowing a velocity of 0 as replacement for `Noteoff` made instruments featuring midi more affordable. \ No newline at end of file +Only sending `Noteon` messages is sufficient for most midi, because most of them don't really care if you use proper `Noteoff` messages or simply send a `Noteon` with a velocity of 0. This is due to the early days of midi, when integrated circuits were expensive. Allowing a velocity of 0 as replacement for `Noteoff` made instruments featuring midi more affordable. diff --git a/docs/samples/rcon.md b/docs/samples/rcon.md index a6e5eef7..3f31fbfc 100644 --- a/docs/samples/rcon.md +++ b/docs/samples/rcon.md @@ -17,7 +17,7 @@ The rcon sample bundle in `samples/rcon-minecraft` shows how to send a command t 4. Create a new rcon service instance using the left upper menu. -5. Enter the host, port, and password of the rcon connection. This can be found in the ``server.properties`` file (`rcon.port`, `rcon.password`) +5. Enter the host, port, and password of the rcon connection. This can be found in the `server.properties` file (`rcon.port`, `rcon.password`) The created instance should be automatically selected, if not select it in the upper left menu. Enter your host and port in monaco (the text-editor on the right) in this format: diff --git a/docs/samples/serial.md b/docs/samples/serial.md index e686f02f..2f25d6db 100644 --- a/docs/samples/serial.md +++ b/docs/samples/serial.md @@ -26,16 +26,16 @@ The serial example bundle in `samples/serial` demonstrates the ability to exchan ```json { "device": { - "port": "COM1" + "port": "COM1" } } ``` ```json { - "device": { - "pnpId": "usb-Arduino__www.arduino.cc__0043_75835343030351E0D171-if00" - } + "device": { + "pnpId": "usb-Arduino__www.arduino.cc__0043_75835343030351E0D171-if00" + } } ``` @@ -53,13 +53,13 @@ The serial example bundle in `samples/serial` demonstrates the ability to exchan You should see an error or a success message and nodecg-io will send ping to the microcontroller every 10 seconds. The Arduino device will respond with pong. You should see the pong message displayed in the log. - If you see an error or nothing at all, try making sure your microcontroller is plugged in and recognized correctly. Then restart nodecg, so the service is cleanly restarted. + If you see an error or nothing at all, try making sure your microcontroller is plugged in and recognized correctly. Then restart nodecg, so the service is cleanly restarted. ### Sample Arduino sketch ```cpp String inputString = ""; -boolean stringComplete = false; +boolean stringComplete = false; void setup() { Serial.begin(9600); diff --git a/docs/samples/spotify.md b/docs/samples/spotify.md index 20a246f9..934eb6f8 100644 --- a/docs/samples/spotify.md +++ b/docs/samples/spotify.md @@ -25,9 +25,7 @@ _Note:_ If you don't have a registered application, yet you can follow [this gui ```json { - "scopes": [ - "user-read-playback-state" - ], + "scopes": ["user-read-playback-state"], "clientId": "0123456789abcdef0123456789abcdef", "clientSecret": "0123456789abcdef0123456789abcdef" } @@ -37,7 +35,7 @@ _Note:_ If you don't have a registered application, yet you can follow [this gui _Note:_ If you don't see monaco on the right, try reloading the page. _Note:_ This sample requires the `user-read-playback-state` scope, but you can require other scopes if you want to use functions that require them. - A list of all scopes can be found [here](https://developer.spotify.com/documentation/general/guides/scopes/). + A list of all scopes can be found [here](https://developer.spotify.com/documentation/general/guides/scopes/). 6. Set the created Spotify service instance to the service dependency of the spotify-current-song bundle. diff --git a/docs/samples/sql.md b/docs/samples/sql.md index 3da6291a..be0c9074 100644 --- a/docs/samples/sql.md +++ b/docs/samples/sql.md @@ -43,6 +43,6 @@ _Note:_ If you don't have a database yet and just want to test things you can us 7. Check the nodecg logs - Your first run of the sample bundle will probably fail because your database doesn't contain the used tables. + Your first run of the sample bundle will probably fail because your database doesn't contain the used tables. Check `samples/sql/extension/index.ts` and create the tables as used or create your own tables and adapt the sample accordingly. You can also use this code as a reference on how to use the SQL client to do your queries. diff --git a/docs/samples/tiane.md b/docs/samples/tiane.md index ef2c6096..9e544530 100644 --- a/docs/samples/tiane.md +++ b/docs/samples/tiane.md @@ -11,15 +11,14 @@ The TIANE-Discord example bundle in `samples/tiane-discord` shows how to make TI ### Configure the TIANE sample bundle 1. Edit the file `samples/tiane-discord/extension/index.ts`. Look for this line: - + ``` const discordChannel = ""; // Insert channel for the discord bot here ``` - + Put the channel ID of a discord channel where you want to talk to TIANE between the quotation marks. See [here](https://github.com/Chikachi/DiscordIntegration/wiki/How-to-get-a-token-and-channel-ID-for-Discord) to find out how to get a channel ID. - + 2. Run `npm run build` in the main nodecg-io directory. - 3. Edit the file `server/TIANE_config.json` on your TIANE server: ```json @@ -29,7 +28,7 @@ The TIANE-Discord example bundle in `samples/tiane-discord` shows how to make TI "websocket_timeout": 20 } ``` - + Make sure `websocket` is either set to `enabled` or `secure` and set a port of your desire. 4. Start nodecg with nodecg-io installed. The TIANE-Discord bundle is currently part of it, so it should also be loaded. @@ -53,7 +52,7 @@ The TIANE-Discord example bundle in `samples/tiane-discord` shows how to make TI After entering it, click save. _Note:_ If you don't see the editor on the right, try reloading the page. - + 9. Create a new Discord service instance. (See the [Discord Sample](discord.md) on how to do this) 10. Set the created TIANE and Discord service instances to the service dependency of the TIANE-Discord bundle. diff --git a/docs/samples/twitch-addons.md b/docs/samples/twitch-addons.md index 48de583e..920c6014 100644 --- a/docs/samples/twitch-addons.md +++ b/docs/samples/twitch-addons.md @@ -21,7 +21,7 @@ _Note:_ If you don't have such a key yet, you can generate it on + - Shortcut URL: > _Note:_ If you don't have such a key yet, you can generate them like [this](https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred). As redirect URI add . From 31722135dde0ef7924d91314d759b39c9c2c685a Mon Sep 17 00:00:00 2001 From: Tim_Tech_Dev Date: Mon, 18 Oct 2021 18:24:04 +0200 Subject: [PATCH 3/3] Format mqtt-client.md Signed-off-by: Tim_Tech_Dev --- docs/samples/mqtt-client.md | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/docs/samples/mqtt-client.md b/docs/samples/mqtt-client.md index 94266c15..b152db66 100644 --- a/docs/samples/mqtt-client.md +++ b/docs/samples/mqtt-client.md @@ -4,39 +4,31 @@ The MQTT-client sample bundle in `samples/mqtt-client` shows how to connect to a ### Prerequisites -- Working NodeCG & nodecg-io installation -- MQTT-server +- Working NodeCG & nodecg-io installation +- MQTT-server ### Configure the MQTT-client sample bundle -1. Start nodecg with nodecg-io installed. The mqtt-client bundle is currently part of it, so it should also be loaded. - -2. Go to the `nodecg-io` tab in the nodecg dashboard. - +1. Start NodeCG with nodecg-io installed. The mqtt-client bundle is currently part of it, so it should also be loaded. +2. Go to the `nodecg-io` tab in the NodeCG dashboard. 3. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials. - 4. Create a new mqtt-client service instance using the left upper menu. -5. Enter the connection parameters of the mqtt server. The URL should be in following the pattern `://
:`. Allowed protcols are: `mqtt`, `mqtts`, `tcp`, `tls`, `ws`, `wss` - - In case your server needs authentification set the `username` and `password` fields otherwise remove them from the configuration. +5. Enter the connection parameters of the mqtt server. The URL should be in following the pattern `://
:`. Allowed protocols are: `mqtt`, `mqtts`, `tcp`, `tls`, `ws`, `wss`. + In case your server needs authentication, set the `username` and `password` fields otherwise remove them from the configuration. The created instance should be automatically selected, if not select it in the upper left menu. Enter your configuration in monaco (the text-editor on the right) in this format: - + ```json - { + { "address": "mqtt://localhost", - "topics": [ - "sample/topic", - "diffrent/topic2" - ], + "topics": ["sample/topic", "diffrent/topic2"], "username": "yourUser", "password": "yourPassword" - } + } ``` After entering it, click save. 6. Set the created mqtt-client service instance to the service dependency of the mqtt-client bundle. - -7. The console should display if the connction was successfully established and should show inbound messages on the subscribed topic. +7. The console should display if the connection was successfully established and should show inbound messages on the subscribed topic.