/nodecg-io-docs.git
+```
+
+## Repository structure
+
+```plain
+|-- .github ................ CI workflows
+|-- .vscode ................ VS Code specific configs
+|-- docs ................... All files included in the documentation
+| |-- assets ................ other files used (images)
+| |-- contribute ............ Section on development and documentation
+| |-- getting_started ....... Section on first use
+| |-- samples ............... documentation for the sample bundles
+| |-- dependencies.md ....... One huge UML diagram (auto generated)
+| |-- index.md .............. Home screen of the documentation
+| `-- services.md ........... Availabel Services (auto generated)
+|-- .markdownlint.json ..... markdownlint config file
+|-- .prettierrc.json ....... prettier (formatter) config file
+`-- mkdocs.yml ............. mkdocs config file
+```
+
+## Install dependencies to use the preview
+
+You will need a Python 3 installed. You will also need to install `mkdocs` with
+pip:
+
+```shell
+pip install -r requirements.txt
+```
+
+Now you can serve the local version with:
+
+```shell
+mkdocs serve
+```
+
+Now you can access it in your browser under .
+
+## Using VS Code
+
+### Extensions
+
+For the folks out there who are using VS Code to edit these documents you can
+use the recommended extensions of this workspace by using the `@recommended `
+filter in the extensions panel. Those extensions will format (`Prettier`) and
+lint (`markdownlint`) the markdown files, and live check many typos and grammar
+(`LTeX`). Also, the built-in preview will parse more of our used syntax.
+
+### Tasks
+
+!!! NOTE
+
+ You will need prettier and markdownlint installed in your path.
+
+You may also benefit from the preconfigured serve task. It can be accessed with
+Ctrl + Shift + B (CMD +
+Shift + B on macOS). This will format and lint the files
+and then serve them to you.
diff --git a/docs/contribute/sample_documentation.md b/docs/contribute/sample_documentation.md
deleted file mode 100644
index 3f245963..00000000
--- a/docs/contribute/sample_documentation.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Add your sample to the docs
-
-To document a sample bundle take a look at the name of the service the sample bundle is for. If it's for example `nodecg-io-example` the documentation must go into `docs/samples/example.md` in the doc's repository. There you should include a step-by-step manual how to configure the service and get the bundle running.
-
-Don't forget to add the newly created Markdown file to `mkdocs.yml`. When you create your documentation pull request, please include the ID of your PR in the main repository in the description, so the documentation will not be merged before the actual code.
-
-You should make this very detailed, so everyone gets it to work because a super-good implementation is worth nothing if there's nobody who can use it. Take a look at the [twitch sample bundle](../samples/twitch-chat.md).
diff --git a/docs/getting_started/configuration.md b/docs/getting_started/configuration.md
index 56441a36..a13746c1 100644
--- a/docs/getting_started/configuration.md
+++ b/docs/getting_started/configuration.md
@@ -1,32 +1,48 @@
# Configuration
-Since version `0.2.0` nodecg-io has a configuration feature to save some settings without needing to code something or log in. The configuration file for
-this feature is at `cfg/nodecg-io-core.json` inside your nodecg installation. This file does not exist by default, you need to create it yourself.
+Since version `0.2.0` nodecg-io has a configuration feature to save some
+settings without needing to code something or log in. The configuration file for
+this feature is at `cfg/nodecg-io-core.json` inside your NodeCG installation.
+This file does not exist by default, you need to create it yourself.
-The currently only thing you can configure is automatic login, but there may be more configurable options in the future.
+The currently only thing you can configure is automatic login, but there may be
+more configurable options in the future.
## Automatic login
-Automatic login will automatically load nodecg-io when nodecg starts using the provided password.
+Automatic login will automatically load nodecg-io when NodeCG starts using the
+provided password.
-Therefore, nodecg-io will be able to decrypt your configuration for your service instances and provide your bundles with service clients without you logging in to nodecg-io using the dashboard.
-This is especially useful if you are running nodecg with nodecg-io on a server which may reboot from time to time to ensure that your bundles are always working without you needing to manually log in after each restart.
+Therefore, nodecg-io will be able to decrypt your configuration for your service
+instances and provide your bundles with service clients without you logging in
+to nodecg-io using the dashboard. This is especially useful if you are running
+NodeCG with nodecg-io on a server which may reboot from time to time to ensure
+that your bundles are always working without you needing to manually log in
+after each restart.
-**Security warning:** Having both the encrypted configuration and your used password saved on disk defeats nodecg-io's data-at-rest encryption.
-Any program that can read disk contents can access your credentials of any service instance. We discourage using this and if you really want to use it you should be extra cautious about which bundles you install.
+!!! WARNING Security warning
+
+ Having both the encrypted configuration and your used password saved on disk
+ defeats nodecg-io's data-at-rest encryption.
+
+ Any program that can read disk contents can access your credentials of any
+ service instance. We discourage using this and if you really want to use it
+ you should be extra cautious about which bundles you install.
Options of automatic login:
- `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 `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)
- 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 212cd15c..4c5371b6 100644
--- a/docs/getting_started/create_new_bundle.md
+++ b/docs/getting_started/create_new_bundle.md
@@ -1,44 +1,67 @@
# Create your first bundle
-To actually use nodecg-io you need to create a bundle. Here's a step-by-step guide to create one.
+To actually use nodecg-io you need to create a bundle. Here's a step-by-step
+guide to create one.
-Think of what services your bundle needs. Take a look at the [service list](../services.md) if to see what services are available. If you need a service that is not yet available consider [creating it](../contribute/create_service.md).
+Think of what services your bundle needs. Take a look at the
+[service list](../services.md) if to see what services are available. If you
+need a service that is not yet available consider
+[creating it](../contribute/create_service.md).
## Create your bundle using the nodecg-io CLI
-Automatically generating a bundle that uses nodecg-io requires that you have the nodecg-io CLI installed. A guide on how to do this is inside the [installation guide](./install.md). Also note that this currently only works when you have installed a release version, not development versions.
+Automatically generating a bundle that uses nodecg-io requires that you have the
+nodecg-io CLI installed. A guide on how to do this is inside the
+[installation guide](./install.md).
-To start run this command while being inside your nodecg installation:
+!!! NOTE
+
+ Also note that this currently only works when you have installed a release
+ version, not development versions.
+
+To start run this command while being inside your NodeCG installation:
```shell
nodecg-io generate
```
-This will ask you a couple details about your bundle like name, description and used services.
-Most questions have a reasonable default that you can choose if you don't care or are not sure about the asked thing.
+This will ask you a couple details about your bundle like name, description and
+used services. Most questions have a reasonable default that you can choose if
+you don't care or are not sure about the asked thing.
-After finishing the prompt the CLI will generate your bundle, install dependencies and, if you have chosen TypeScript, compile the generated code.
+After finishing the prompt the CLI will generate your bundle, install
+dependencies and, if you have chosen TypeScript, compile the generated code.
## Test it
-Start NodeCG and make sure that the bundle gets loaded successfully, and it is displayed in the nodecg-io dashboard with all service dependencies.
+Start NodeCG and make sure that the bundle gets loaded successfully, and it is
+displayed in the nodecg-io dashboard with all service dependencies.
## Modify it
-After that you should edit the `extension/index.ts` or `extension/index.js` depending on your chosen language to do something useful.
-You can start by updating the `onAvailable` callbacks.
+After that you should edit the `extension/index.ts` or `extension/index.js`
+depending on your chosen language to do something useful. You can start by
+updating the `onAvailable` callbacks.
-_Note:_ If you need to access another service inside the callback of a `onAvailable` call you can use `otherService.getClient()` to get the client or `undefined` if it is not set.
+_Note:_ If you need to access another service inside the callback of a
+`onAvailable` call you can use `otherService.getClient()` to get the client or
+`undefined` if it is not set.
## Further steps
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/)
+- 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!
-If you share your work others might find it useful and get happy with it. We made nodecg-io for you, and the nodecg people made nodecg for you. Many people spent much time for you to create cool content that easy and if you shared your work others could create good content more easily as well.
+If you share your work others might find it useful and get happy with it. We
+made nodecg-io for you, and the NodeCG people made NodeCG for you. Many people
+spent much time for you to create cool content that easy and if you shared your
+work others could create good content more easily as well.
diff --git a/docs/getting_started/existing_bundle.md b/docs/getting_started/existing_bundle.md
index 93a6c31d..cfbac2cf 100644
--- a/docs/getting_started/existing_bundle.md
+++ b/docs/getting_started/existing_bundle.md
@@ -1,16 +1,20 @@
# Migrating your existing bundle to nodecg-io
-This guide explains to you how to migrate an existing nodecg bundle that already meets your requirements to use nodecg-io.
-nodecg-io manages service configuration and authentication, so your bundle doesn't have to bother with it.
+This guide explains to you how to migrate an existing NodeCG bundle that already
+meets your requirements to use nodecg-io. nodecg-io manages service
+configuration and authentication, so your bundle doesn't have to bother with it.
-If you are lucky and used the same library as we do for the service you want to migrate, nodecg-io is a drop-in replacement just doing authentication and configuration.
-If you have used another library, you'll have to do a little more work to migrate to the library that our service uses.
-In that case make sure that the migration is worth the effort.
-You can use nodecg-io for one service and use your own library of choice for other services if you like to.
+If you are lucky and used the same library as we do for the service you want to
+migrate, nodecg-io is a drop-in replacement just doing authentication and
+configuration. If you have used another library, you'll have to do a little more
+work to migrate to the library that our service uses. In that case make sure
+that the migration is worth the effort. You can use nodecg-io for one service
+and use your own library of choice for other services if you like to.
## Install `nodecg-io-core`
-The first thing you need to do is to install `nodecg-io-core`. You can do this simply using this npm command:
+The first thing you need to do is to install `nodecg-io-core`. You can do this
+simply using this npm command:
```shell
npm install nodecg-io-core
@@ -18,7 +22,8 @@ npm install nodecg-io-core
## Import `requireService`
-Now that you have `nodecg-io-core` installed in your bundle you can import the `requireService` function that it exposes:
+Now that you have `nodecg-io-core` installed in your bundle you can import the
+`requireService` function that it exposes:
=== "TypeScript/ES Modules"
@@ -34,28 +39,34 @@ Now that you have `nodecg-io-core` installed in your bundle you can import the `
## Import Service type (TypeScript only)
-If you're using TypeScript, you'll also need to install the package of the service that you want to use.
-You need it to be able to import its type for type safety.
+If you're using TypeScript, you'll also need to install the package of the
+service that you want to use. You need it to be able to import its type for type
+safety.
-This example uses `twitch-chat` as an example, but you can just replace it with the name of the service you need.
+This example uses `twitch-chat` as an example, but you can just replace it with
+the name of the service you need.
-=== "TypeScript"
+```shell
+npm install nodecg-io-twitch-chat
+```
- ```shell
- npm install nodecg-io-twitch-chat
- ```
+=== "TypeScript"
```typescript
import { TwitchChatServiceClient } from "nodecg-io-twitch-chat";
```
-Note: You can get the name of the type by using autocomplete in your editor or by looking it up in the service sample.
+!!! NOTE
+
+ You can get the name of the type by using autocomplete in your editor or by
+ looking it up in the service sample.
## Require the service
-Now you can finally tell nodecg-io that you want to get access to a service using the `requireService` function.
-You'll have to pass your nodecg instance which is used to identify your bundle and the name of the service you want.
-In case of TypeScript you'll also need to provide the type of the service.
+Now you can finally tell nodecg-io that you want to get access to a service
+using the `requireService` function. You'll have to pass your NodeCG instance
+which is used to identify your bundle and the name of the service you want. In
+case of TypeScript you'll also need to provide the type of the service.
=== "TypeScript"
@@ -73,38 +84,51 @@ In case of TypeScript you'll also need to provide the type of the service.
### Using `onAvailable` and `onUnavailable` handlers
-You can set up handlers that are executed when the user assigns a service instance to your bundle, removes the assignment or when the service client got updated in some way.
+You can set up handlers that are executed when the user assigns a service
+instance to your bundle, removes the assignment or when the service client got
+updated in some way.
-Handlers added with `onAvailable` will get called if there was a change and you got a client:
+Handlers added with `onAvailable` will get called if there was a change, and you
+got a client:
-```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) => {
- nodecg.log.info("Client was set");
- // You can use the passed client in here to e.g. setup handlers on the client
-});
-```
+=== "TypeScript"
-`onAvailable` is especially useful to add event handlers to clients.
-E.g., if you want to react to donations or chat messages you can add event handlers for these here.
+ ```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) => {
+ nodecg.log.info("Client was set");
+ // You can use the passed client in here to e.g. setup handlers on the client
+ });
+ ```
-Handlers added with `onUnavailable` will get called if your bundle was not assigned a service instance or if there was an error in service client creation:
+`onAvailable` is especially useful to add event handlers to clients. E.g., if
+you want to react to donations or chat messages you can add event handlers for
+these here.
-```typescript
-twitchChat.onUnavailable(() => {
- nodecg.log.info("Client was unset");
-});
-```
+Handlers added with `onUnavailable` will get called if the user unassigned your
+bundle from service instance or if there was an error in service client
+creation:
+
+=== "TypeScript"
+
+ ```typescript
+ twitchChat.onUnavailable(() => {
+ nodecg.log.info("Client was unset");
+ });
+ ```
### Using `getClient`
Instead of callbacks you can also get access to the client directly:
-```typescript
-const twitchChatClient = twitchChat.getClient();
-```
+=== "TypeScript"
+
+ ```typescript
+ const twitchChatClient = twitchChat.getClient();
+ ```
-`getClient` will return the client if your bundle has an assigned service instance that has produced a service client without error
-and will return `undefined` otherwise.
-This is useful for when you want to use the client due to some external event or from `onAvailable` handlers of other services.
+`getClient` will return the client if your bundle has an assigned service
+instance that has produced a service client without error and will return
+`undefined` otherwise. This is useful for when you want to use the client due to
+some external event or from `onAvailable` handlers of other services.
diff --git a/docs/getting_started/install.md b/docs/getting_started/install.md
index 372640fc..290e4614 100644
--- a/docs/getting_started/install.md
+++ b/docs/getting_started/install.md
@@ -26,37 +26,37 @@ that this list might not be up-to-date.
Here's how to install the native build tools on the most popular operating
systems, if you need them:
-#### Windows
+=== "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**:
+ 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**:
-```shell
-npm install -g windows-build-tools
-```
+ ```shell
+ npm install -g windows-build-tools
+ ```
-#### Linux
+=== "Linux"
-For Linux, you'll need a C++ compiler and some other packages. On Ubuntu/Debian
-based operating systems run the following command:
+ For Linux, you'll need a C++ compiler and some other packages. On Ubuntu/Debian
+ based operating systems run the following command:
-```shell
-sudo apt install build-essential libusb-1.0-0-dev libasound2-dev libudev-dev
-```
+ ```shell
+ sudo apt install build-essential libusb-1.0-0-dev libasound2-dev libudev-dev
+ ```
-For other Linux distros you'll need the corresponding packages, just search on
-the internet how the packages are named for your specific distro.
+ For other Linux distros you'll need the corresponding packages, just search on
+ the internet for the packages on your specific distro.
-#### macOS
+=== "macOS"
-For macOS, you'll need the Xcode command line tools. To install them run the
-following command:
+ For macOS, you'll need the Xcode command line tools. To install them run the
+ following command:
-```shell
-xcode-select --install
-```
+ ```shell
+ xcode-select --install
+ ```
## Install the nodecg-io CLI
@@ -66,16 +66,21 @@ Install the nodecg-io CLI using the following command:
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))
+!!! 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
-> nodecg-io will always be installed into a `nodecg-io/` directory inside your
-> NodeCG installation so that your bundles and all bundles from nodecg-io are
-> separated. The CLI will add this path to the loaded bundles in your NodeCG
-> configuration automatically, you don't need to worry about it.
+!!! INFO
+
+ nodecg-io will always be installed into a `nodecg-io/` directory inside your
+ NodeCG installation so that your bundles and all bundles from nodecg-io are
+ separated. The CLI will add this path to the loaded bundles in your NodeCG
+ configuration automatically, you don't need to worry about it.
With the nodecg-io CLI installed you can run this command inside a NodeCG
installation to install nodecg-io:
@@ -87,12 +92,12 @@ Installing nodecg-io...
You will get a prompt which asks you which version you want to install:
-user@computer:~/nodecg$ nodecg-io install
+user@computer:~/nodecg$ nodecg-io install
Installing nodecg-io...
Detected nodecg installation at /home/user/nodecg.
? Which version do you want to install? (Use arrow keys)
development
-❯ 0.1
+❯ 0.1
There are two possible installation types:
@@ -110,63 +115,54 @@ There are two possible installation types:
For starters, we recommend using the development version, so you may try our
premade examples.
-### Production install
-
-
- Click to see more!
-
-Because you selected a production install you may select the services to be
-included in this next step:
-
-user@computer:~/nodecg$ nodecg-io install
-Installing nodecg-io...
-Detected nodecg installation at /home/user/nodecg.
-? Which version do you want to install? 0.1
-? Which services do you want to use? (Press <space> to select, <a> to toggle all,
-<i> to invert selection, and <enter> to proceed)
-❯◯ ahk
- ◯ android
- ◯ curseforge
- ◯ discord
- ◯ intellij
- ◯ irc
- ◯ midi-input
-(Move up and down to reveal more choices)
-
-If you want to every change your nodecg-io installation to add/remove a service
-or change the version, you can always re-run `nodecg-io install`. If a nodecg-io
-installation is found, its options will be preselected in the prompt. Re-running
-`nodecg-io install` will also update all packages to the latest patch version.
-
-
-
-### Development install
-
-
- Click to see more!
-
-Because you selected a production install you may select to use the samples and
-documentation to be included in these next steps:
-
-user@computer:~/nodecg$ nodecg-io install
-Installing nodecg-io...
-Detected nodecg installation at /home/user/nodecg.
-? Which version do you want to install? development
-? Would you like to use the provided samples? (y/N)
-
-user@computer:~/nodecg$ nodecg-io install
-Installing nodecg-io...
-Detected nodecg installation at /home/user/nodecg.
-? Which version do you want to install? development
-? Would you like to use the provided samples? No
-? Would you like to clone the documentation? (y/N)
-
-If you want to every change your nodecg-io installation to add/remove a service
-or change the version, you can always re-run `nodecg-io install`. If a nodecg-io
-installation is found, its options will be preselected in the prompt. Re-running
-`nodecg-io install` will also pull the repository and rebuild it.
-
-
+=== "Production install"
+
+ Because you selected a production install you may select the services to be
+ included in this next step:
+
+ user@computer:~/nodecg$ nodecg-io install
+ Installing nodecg-io...
+ Detected nodecg installation at /home/user/nodecg.
+ ? Which version do you want to install? 0.1
+ ? Which services do you want to use? (Press <space> to select, <a> to toggle all,
+ <i> to invert selection, and <enter> to proceed)
+ ❯◯ ahk
+ ◯ android
+ ◯ curseforge
+ ◯ discord
+ ◯ intellij
+ ◯ irc
+ ◯ midi-input
+ (Move up and down to reveal more choices)
+
+ If you want to every change your nodecg-io installation to add/remove a service
+ or change the version, you can always re-run `nodecg-io install`. If it finds a
+ nodecg-io installation, its options will be preselected in the prompt.
+ Re-running `nodecg-io install` will also update all packages to the latest patch
+ version.
+
+=== "Development install"
+
+ Because you selected a production install you may select to use the samples and
+ documentation to be included in these next steps:
+
+ user@computer:~/nodecg$ nodecg-io install
+ Installing nodecg-io...
+ Detected nodecg installation at /home/user/nodecg.
+ ? Which version do you want to install? development
+ ? Would you like to use the provided samples? (y/N)
+
+ user@computer:~/nodecg$ nodecg-io install
+ Installing nodecg-io...
+ Detected nodecg installation at /home/user/nodecg.
+ ? Which version do you want to install? development
+ ? Would you like to use the provided samples? No
+ ? Would you like to clone the documentation? (y/N)
+
+ If you want to every change your nodecg-io installation to add/remove a service
+ or change the version, you can always re-run `nodecg-io install`. If it finds a
+ nodecg-io installation, its options will be preselected in the prompt.
+ Re-running `nodecg-io install` will also pull the repository and rebuild it.
### Continue reading
diff --git a/docs/getting_started/try_example_bundle.md b/docs/getting_started/try_example_bundle.md
index d57abe3a..61f2163a 100644
--- a/docs/getting_started/try_example_bundle.md
+++ b/docs/getting_started/try_example_bundle.md
@@ -3,9 +3,11 @@
Trying one of the premade example bundles is a good way to get to know the
framework and especially the selected service.
-> In case you installed the **production** branch of nodecg-io, you are out of
-> luck. Because the build process will cause problems if you just take one of
-> the samples and rebuild elsewhere.
+!!! ATTENTION
+
+ In case you installed the **production** branch of nodecg-io, you are out of
+ luck. Because the build process will cause problems if you just take one of the
+ samples and rebuild elsewhere.
If you installed **dev** branch via the `nodecg-io-cli` and did not select the
“use the samples”-option run `nodecg-io install` and select it.
@@ -28,7 +30,7 @@ the `Run and Debug` Explorer View:
You may also launch NodeCG using your terminal with:
-user@computer:~/nodecg$ npm run start
+user@computer:~/nodecg$ npm run start
> nodecg@1.8.1 start
> node index.js
@@ -38,7 +40,7 @@ info: [nodecg-io-core] Minzig!
// A whole host of logging output
-info: [nodecg/lib/server] NodeCG running on http://localhost:9090
+info: [nodecg/lib/server] NodeCG running on http://localhost:9090
Now you can open the NodeCG dashboard (by default) under
.
@@ -69,7 +71,7 @@ to arrange yourself with this one. So, to get started:
### In pink: NodeCG Tabs
Here you will find every NodeCG-bundle that has a dashboard. Here you may select
-the [`nodecg-io-debug`](../samples/debug.md)-dashboard, if it is installed.
+the [nodecg-io-debug](../samples/debug.md)-dashboard, if it is installed.
### In yellow: Monaco editor
@@ -112,9 +114,12 @@ This section has three dropdowns:
### In red: Unset all Button
This button will set the service instance for every bundle/service combination
-to none, effectively removing the access to every service from all bundles.
-**Caution**: This can not be undone, and you will have to set up all the bundles
-again. _The service instances will be unaffected._
+to none, effectively removing the access to every service from all bundles.
+
+!!! DANGER
+
+ This can not be undone, and you will have to set up all the bundles
+ again. __The service instances will be unaffected.__
## Step 4: Configure the sample
diff --git a/docs/index.md b/docs/index.md
index 0733d280..595f520b 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -16,13 +16,20 @@
## About nodecg-io
-nodecg-io is the successor of [ChatOverflow](https://github.com/codeoverflow-org/chatoverflow). The aim of this bundle is to simplify the code and expand the number of integrated services. The main goal is to increase the number of supported APIs to save you development time.
+nodecg-io is the successor of
+[ChatOverflow](https://github.com/codeoverflow-org/chatoverflow). The aim of
+this bundle is to simplify the code and expand the number of integrated
+services. The main goal is to increase the number of supported APIs to save you
+development time.
## How to use nodecg-io
-If you want to use nodecg-io, you should note that it is only a framework for your bundle.
-So you need at least a basic knowledge of the programming language JavaScript or any other language that compiles to JavaScript like TypeScript.
-If that's no problem you can head over to the [installation guide](./getting_started/install.md) and take a look at the [available nodecg-io services](./services.md).
+If you want to use nodecg-io, you should note that it is only a framework for
+your bundle. So you need at least a basic knowledge of the programming language
+JavaScript or any other language that compiles to JavaScript like TypeScript. If
+that's no problem you can head over to the
+[installation guide](./getting_started/install.md) and take a look at the
+[available nodecg-io services](./services.md).
## Implemented Services and Interfaces
@@ -68,4 +75,7 @@ If that's no problem you can head over to the [installation guide](./getting_sta
## How to contribute
-If you want to contribute to this bundle you can implement one of those services or fix an [issue](https://github.com/codeoverflow-org/nodecg-io/issues). Before contributing head over to the [“How to contribute”](./contribute/contribute.md)-Guide.
+If you want to contribute to this bundle you can implement one of those services
+or fix an [issue](https://github.com/codeoverflow-org/nodecg-io/issues). Before
+contributing head over to the
+[“How to contribute”](./contribute/contribute.md)-Guide.
diff --git a/docs/samples/artnet.md b/docs/samples/artnet.md
index 21d50d84..82686f3b 100644
--- a/docs/samples/artnet.md
+++ b/docs/samples/artnet.md
@@ -4,7 +4,7 @@ The Art-Net example bundle in `samples/artnet-console` demonstrates the ability
send data via Art-Net to e.g., open lighting architecture or professional
lighting equipment. Here is a guide to how to get it working. The underlying
service is using
-[`jeffreykog/node-artnet-protocol`](https://github.com/jeffreykog/node-artnet-protocol)
+[jeffreykog/node-artnet-protocol](https://github.com/jeffreykog/node-artnet-protocol)
as its library.
### Prerequisites
@@ -21,8 +21,8 @@ will also tell you how to log in and how to use the GUI.
### Configure the Art-Net sample bundle
-1. In NodeCG, create a new Art-Net service instance.
-2. Enter the host to witch the service should broadcast:
+1. In NodeCG, create a new Art-Net service instance.
+2. Enter the host to witch the service should broadcast:
**Host**
@@ -36,12 +36,14 @@ will also tell you how to log in and how to use the GUI.
After entering it, click save.
- You may overwrite this broadcast address in code with
- `client.bind("host address");`.
+ !!! INFO
-3. Set the sample's (`artnet-console`) dependency to be the newly created
- service instance (of type `artnet`).
-4. Check the NodeCG logs. You should see data logged.
+ You may overwrite this broadcast address in code with
+ `#!ts client.bind("host address");`.
+
+3. Set the sample's (`artnet-console`) dependency to be the newly created
+ service instance (of type `artnet`).
+4. Check the NodeCG logs. You should see data logged.
### Explanations
@@ -64,12 +66,7 @@ declare class ArtDmx {
physical: number;
universe: number;
data: number[];
- constructor(
- sequence: number,
- physical: number,
- universe: number,
- data: number[]
- );
+ constructor(sequence: number, physical: number, universe: number, data: number[]);
isSequenceEnabled(): boolean;
static decode(data: Buffer): ArtDmx;
toString(): string;
@@ -90,12 +87,14 @@ setInterval(() => {
}, 800);
```
-_Note_: Since neither this library nor nodecg-io does not yet contain an
-abstraction, so the data is sent to the timings set by the specification, you
-should respect this part of specification in **your implementation**.
+!!! NOTE
+
+ Since neither this library nor nodecg-io does not yet contain an
+ abstraction, so the data is sent to the timings set by the specification, you
+ should respect this part of specification in **your implementation**.
-> However, an input that is active but not changing, will re-transmit the last
-> valid ArtDmx packet at approximately 4-second intervals. (_Note_. In order to
-> converge the needs of Art- Net and sACN it is recommended that Art-Net devices
-> actually use a re-transmit time of 800mS to 1000mS).
-> — [Art-Net 4 Specification p. 48](https://artisticlicence.com/WebSiteMaster/User%20Guides/art-net.pdf)
+ > However, an input that is active but not changing, will re-transmit the last
+ > valid ArtDmx packet at approximately 4-second intervals. (_Note_. In order to
+ > converge the needs of Art- Net and sACN it is recommended that Art-Net devices
+ > actually use a re-transmit time of 800mS to 1000mS).
+ > — [Art-Net 4 Specification p. 48](https://artisticlicence.com/WebSiteMaster/User%20Guides/art-net.pdf)
diff --git a/docs/samples/discord-rpc.md b/docs/samples/discord-rpc.md
index 29540fe5..2927e799 100644
--- a/docs/samples/discord-rpc.md
+++ b/docs/samples/discord-rpc.md
@@ -16,8 +16,10 @@ will also tell you how to log in and how to use the GUI.
- A discord application with permissions `indentify` and `rpc`
-_Note:_ If you don't have an application yet, you can create one
-[here](https://discord.com/developers/applications)
+!!! Note
+
+ If you don't have an application yet, you can create one
+ [here](https://discord.com/developers/applications)
### Configure the Discord RPC sample bundle
diff --git a/docs/samples/discord.md b/docs/samples/discord.md
index 008fe712..bb4ce309 100644
--- a/docs/samples/discord.md
+++ b/docs/samples/discord.md
@@ -16,9 +16,11 @@ will also tell you how to log in and how to use the GUI.
- A Discord Bot token
-_Note:_ If you don't have such a token yet, you can follow
-[this](https://discordjs.guide/preparations/setting-up-a-bot-application.html)
-guide.
+!!! Note
+
+ If you don't have such a token yet, you can follow
+ [this](https://discordjs.guide/preparations/setting-up-a-bot-application.html)
+ guide.
### Configure the Discord sample bundle
diff --git a/docs/samples/github.md b/docs/samples/github.md
index 0c1a5f48..d37c4313 100644
--- a/docs/samples/github.md
+++ b/docs/samples/github.md
@@ -15,9 +15,11 @@ will also tell you how to log in and how to use the GUI.
- A GitHub token
-_Note:_ If you don't have a token yet, you can create one
-[here](https://github.com/settings/tokens/new). The token requires at least the
-`repo` scope.
+!!! Note
+
+ If you don't have a token yet, you can create one
+ [here](https://github.com/settings/tokens/new). The token requires at least the
+ `repo` scope.
### Configure the GitHub sample bundle
diff --git a/docs/samples/gsheets.md b/docs/samples/gsheets.md
index 2205fe0c..bcaae06e 100644
--- a/docs/samples/gsheets.md
+++ b/docs/samples/gsheets.md
@@ -16,17 +16,20 @@ will also tell you how to log in and how to use the GUI.
- Google cloud API OAuth access (client ID, client Secret)
- Grant `Google Sheets API v4` access at the project's dashboard.
- Shortcut URL:
- >
+ `https://console.developers.google.com/apis/library/sheets.googleapis.com?project=`.
-_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
-.
+!!! 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:
+
+
### Configure the gsheets sample bundle
-1. In NodeCG, create a new googleapis service instance.
-2. Enter the credentials for googleapis:
+1. In NodeCG, create a new googleapis service instance.
+2. Enter the credentials for googleapis:
```json
{
@@ -38,12 +41,14 @@ As the redirect URI add
After entering it, click save.
- _Note:_ You can add multiple scopes if the googleapis instance is used for
- multiple bundles.
+ !!! Note
+
+ You can add multiple scopes if the googleapis instance is used for
+ multiple bundles.
-3. Set the sample's (`gsheets`) dependency to be the newly created service
- instance (of type `googleapis`).
-4. Check the NodeCG logs:
+3. Set the sample's (`gsheets`) dependency to be the newly created service
+ instance (of type `googleapis`).
+4. Check the NodeCG logs:
You should see an error or a success message that is hardcoded in
`samples/gsheets/extension/index.ts`.
diff --git a/docs/samples/intellij.md b/docs/samples/intellij.md
index c93325ea..6671c7d9 100644
--- a/docs/samples/intellij.md
+++ b/docs/samples/intellij.md
@@ -30,7 +30,7 @@ will also tell you how to log in and how to use the GUI.
1. In NodeCG, create a new IntelliJ service instance.
2. Enter the host and port of your IDE's HTTP server:
- ```
+ ```json
{
"address": "127.0.0.1:19524"
}
diff --git a/docs/samples/midi-input.md b/docs/samples/midi-input.md
index b86d4239..a8eaeab8 100644
--- a/docs/samples/midi-input.md
+++ b/docs/samples/midi-input.md
@@ -17,9 +17,9 @@ will also tell you how to log in and how to use the GUI.
### Configure the midi-input sample bundle
-1. In NodeCG, create a new midi-input service instance.
+1. In NodeCG, create a new midi-input service instance.
-2. Enter your device information:
+2. Enter your device information:
```json
{
@@ -27,20 +27,24 @@ will also tell you how to log in and how to use the GUI.
}
```
- 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.
- Under Linux this looks for example like this:
+ After entering it, click save.
- ```
- nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0
- ```
+ !!! 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:
+
+ ```plain
+ nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0
+ ```
-3. Set the sample's (`midi-input`) dependency to be the newly created service
- instance (of type `midi-input`).
-4. Check the NodeCG logs:
+3. Set the sample's (`midi-input`) dependency to be the newly created service
+ instance (of type `midi-input`).
+4. Check the NodeCG logs:
You should see an error or a success message and all midi messages that are
sent by the device that is configured.
diff --git a/docs/samples/midi-io.md b/docs/samples/midi-io.md
index 8bdf9924..83f079e2 100644
--- a/docs/samples/midi-io.md
+++ b/docs/samples/midi-io.md
@@ -17,9 +17,9 @@ will also tell you how to log in and how to use the GUI.
### Configure the midi-io sample bundle
-1. In NodeCG, create a new midi-input service instance.
+1. In NodeCG, create a new midi-input service instance.
-2. Enter your device information:
+2. Enter your device information:
```json
{
@@ -27,23 +27,27 @@ will also tell you how to log in and how to use the GUI.
}
```
- 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.
- Under Linux this looks for example like this:
+ After entering it, click save.
- ```
- nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0
- ```
+ !!! 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:
+
+ ```plain
+ nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0
+ ```
-3. Create a new midi-output service instance using the left upper menu.
+3. Create a new midi-output service instance using the left upper menu.
-4. Set the sample's (`midi-io`) dependencies to be the newly created service
- instances (of type `midi-input` & `midi-output`).
+4. Set the sample's (`midi-io`) dependencies to be the newly created service
+ instances (of type `midi-input` & `midi-output`).
-5. Check the NodeCG logs:
+5. Check the NodeCG logs:
You should see an error or a success message and midi messages that are
received and echoed back to the device that is configured. The messages are
diff --git a/docs/samples/midi-output.md b/docs/samples/midi-output.md
index 788c4c77..031ff664 100644
--- a/docs/samples/midi-output.md
+++ b/docs/samples/midi-output.md
@@ -17,9 +17,9 @@ will also tell you how to log in and how to use the GUI.
### Configure the midi-output sample bundle
-1. In NodeCG, create a new midi-output service instance.
+1. In NodeCG, create a new midi-output service instance.
-2. Enter your device information:
+2. Enter your device information:
```json
{
@@ -27,21 +27,25 @@ will also tell you how to log in and how to use the GUI.
}
```
- 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.
- Under Linux this looks for example like this:
+ After entering it, click save.
- ```
- nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0
- ```
+ !!! 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:
+
+ ```plain
+ nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0
+ ```
-3. Set the sample's (`midi-output`) dependency to be the newly created service
- instance (of type `midi-output`).
+3. Set the sample's (`midi-output`) dependency to be the newly created service
+ instance (of type `midi-output`).
-4. Check the NodeCG logs:
+4. Check the NodeCG logs:
You should see an error or a success message and random midi messages should
be sent to the device that is configured. The messages are only `Noteon`
diff --git a/docs/samples/nanoleaf.md b/docs/samples/nanoleaf.md
index 3ee86236..c10bf8be 100644
--- a/docs/samples/nanoleaf.md
+++ b/docs/samples/nanoleaf.md
@@ -18,9 +18,9 @@ will also tell you how to log in and how to use the GUI.
### Configure the nanoleaf sample bundle
-1. In NodeCG, create a new nanoleaf service instance.
+1. In NodeCG, create a new nanoleaf service instance.
-2. Enter the IP address of your nanoleaf controller:
+2. Enter the IP address of your nanoleaf controller:
```json
{
@@ -28,13 +28,15 @@ will also tell you how to log in and how to use the GUI.
}
```
- Before clicking save put your nanoleaf controller into pairing mode by
- holding the on-off button for 5-7 seconds till the LED starts flashing.
+ !!! ATTENTION
- After entering your config and entering pairing mode, click save.
+ Before clicking save put your nanoleaf controller into pairing mode by
+ holding the on-off button for 5-7 seconds till the LED starts flashing.
-3. Set the sample's (`nanoleaf`) dependency to be the newly created service
- instance (of type `nanoleaf`).
+ After entering your config and entering pairing mode, click save.
-4. If everything worked, your nanoleafs should now shine orange.
- If not you should check the NodeCG logs for any errors.
+3. Set the sample's (`nanoleaf`) dependency to be the newly created service
+ instance (of type `nanoleaf`).
+
+4. If everything worked, your nanoleafs should now shine orange.
+ If not you should check the NodeCG logs for any errors.
diff --git a/docs/samples/obs.md b/docs/samples/obs.md
index 32a7347d..2f82c9db 100644
--- a/docs/samples/obs.md
+++ b/docs/samples/obs.md
@@ -16,15 +16,17 @@ will also tell you how to log in and how to use the GUI.
- OBS with obs-websocket installed
-_Note:_ OBS is available [here](https://obsproject.com/de/download) and
-obs-websocket with install instructions is available
-[here](https://github.com/Palakis/obs-websocket/releases).
+!!! NOTE
+
+ OBS is available [here](https://obsproject.com/de/download) and
+ obs-websocket with install instructions is available
+ [here](https://github.com/Palakis/obs-websocket/releases).
### Configure the OBS sample bundle
-1. In NodeCG, create a new obs service instance.
+1. In NodeCG, create a new obs service instance.
-2. Enter the configuration for obs:
+2. Enter the configuration for obs:
```json
{
@@ -34,15 +36,17 @@ obs-websocket with install instructions is available
}
```
- If you don't want to use a password, you can just remove the password
- property from the config.
+ !!! INFO
+
+ If you don't want to use a password, you can just remove the password
+ property from the config.
After entering it, click save.
-3. Set the sample's (`obs-scenelist`) dependency to be the newly created service
- instance (of type `obs`).
+3. Set the sample's (`obs-scenelist`) dependency to be the newly created
+ service instance (of type `obs`).
-4. Check the NodeCG logs:
+4. Check the NodeCG logs:
You should see an error or a success message and the names of all you scenes
that you have set in OBS.
diff --git a/docs/samples/philipshue.md b/docs/samples/philipshue.md
index 482a4e9d..b24b17db 100644
--- a/docs/samples/philipshue.md
+++ b/docs/samples/philipshue.md
@@ -18,9 +18,9 @@ will also tell you how to log in and how to use the GUI.
### Configure the Philips Hue sample bundle
-1. In NodeCG, create a new Philips Hue service instance.
+1. In NodeCG, create a new Philips Hue service instance.
-2. Enter configuration for hue.
+2. Enter configuration for hue.
If you want the bridge to be automatically discovered just set `discover` to
true like this:
@@ -44,14 +44,16 @@ will also tell you how to log in and how to use the GUI.
After entering it, press the big link button on your bridge and then click
save.
- After the first time you connect to your bridge it will create a user and an
- API key which will be saved so that you only need to press the link button
- when you connect it for the first time.
+ !!! INFO
-3. Set the sample's (`philipshue-lights`) dependency to be the newly created
- service instance (of type `philipshue`).
+ After the first time you connect to your bridge it will create a user and an
+ API key which will be saved so that you only need to press the link button
+ when you connect it for the first time.
-4. Check the NodeCG logs:
+3. Set the sample's (`philipshue-lights`) dependency to be the newly created
+ service instance (of type `philipshue`).
+
+4. Check the NodeCG logs:
You should see an error or a success message and the number of lights that
the bridge knows of.
diff --git a/docs/samples/rcon.md b/docs/samples/rcon.md
index 7946c06f..c3862594 100644
--- a/docs/samples/rcon.md
+++ b/docs/samples/rcon.md
@@ -1,6 +1,6 @@
## Using the RCON sample bundle
-The rcon sample bundle in `samples/rcon-minecraft` shows how to send a command
+The RCON sample bundle in `samples/rcon-minecraft` shows how to send a command
to a Minecraft server.
### Prerequisites
@@ -15,11 +15,11 @@ will also tell you how to log in and how to use the GUI.
- A working [Minecraft](https://minecraft.net) server.
-### Configure the rcon sample bundle
+### Configure the RCON sample bundle
-1. In NodeCG, create a new rcon service instance.
+1. In NodeCG, create a new RCON service instance.
-2. Enter the host, port, and password of the rcon connection. This can be found
+2. Enter the host, port, and password of the RCON connection. This can be found
in the `server.properties` file (`rcon.port`, `rcon.password`):
```json
diff --git a/docs/samples/reddit.md b/docs/samples/reddit.md
index 08609f7c..8380e957 100644
--- a/docs/samples/reddit.md
+++ b/docs/samples/reddit.md
@@ -15,8 +15,10 @@ will also tell you how to log in and how to use the GUI.
- A Reddit Application (Should be of type script for own purpose)
-_Note:_ If you don't have such an application yet, you can get one
-[here](https://www.reddit.com/prefs/apps).
+!!! NOTE
+
+ If you don't have such an application yet, you can get one
+ [here](https://www.reddit.com/prefs/apps).
### Configure the Reddit sample bundle
diff --git a/docs/samples/serial.md b/docs/samples/serial.md
index 67965d3f..d5039807 100644
--- a/docs/samples/serial.md
+++ b/docs/samples/serial.md
@@ -19,9 +19,9 @@ will also tell you how to log in and how to use the GUI.
### Configure the serial sample bundle
-1. In NodeCG, create a new serial service instance.
+1. In NodeCG, create a new serial service instance.
-2. Enter the information of your device:
+2. Enter the information of your device:
```json
{
@@ -41,15 +41,17 @@ will also tell you how to log in and how to use the GUI.
After entering it, click save.
- _Note:_ If you want to list all connected devices you can open a terminal in
- `nodecg-io-serial` and run `npm run list`. _Note:_ If you are using multiple
- devices you might want to use the `pnpId`, since ports can change between
- reboots!
+ !!! NOTE
-3. Set the sample's (`serial`) dependency to be the newly created service
- instance (of type `serial`).
+ If you want to list all connected devices you can open a terminal in
+ `nodecg-io-serial` and run `npm run list`. _Note:_ If you are using multiple
+ devices you might want to use the `pnpId`, since ports can change between
+ reboots!
-4. Check the NodeCG logs:
+3. Set the sample's (`serial`) dependency to be the newly created service
+ instance (of type `serial`).
+
+4. Check the NodeCG logs:
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
diff --git a/docs/samples/shlink.md b/docs/samples/shlink.md
index 6adf7def..f31d9739 100644
--- a/docs/samples/shlink.md
+++ b/docs/samples/shlink.md
@@ -19,8 +19,8 @@ will also tell you how to log in and how to use the GUI.
### Configure the Shlink sample bundle
-1. In NodeCG, create a new Shlink service instance.
-2. Enter the configuration for Shlink:
+1. In NodeCG, create a new Shlink service instance.
+2. Enter the configuration for Shlink:
```json
{
@@ -31,14 +31,16 @@ will also tell you how to log in and how to use the GUI.
After entering it, click save.
-3. Set the sample's (`shlink-list-short-urls`) dependency to be the newly
- created service instance (of type `shlink`).
+3. Set the sample's (`shlink-list-short-urls`) dependency to be the newly
+ created service instance (of type `shlink`).
-4. Check the NodeCG logs:
+4. Check the NodeCG logs:
You should see an error or a success message and the amount of configured
short URLs on the Shlink server.
- _Note:_ When listing short URLs — like this sample does — be aware that the
- amount of short URLs might be limited by the
- [API key role](https://shlink.io/documentation/api-docs/api-key-roles/).
+ !!! NOTE
+
+ When listing short URLs — like this sample does — be aware that the
+ amount of short URLs might be limited by the
+ [API key role](https://shlink.io/documentation/api-docs/api-key-roles/).
diff --git a/docs/samples/slack.md b/docs/samples/slack.md
index 6574de51..ede10d84 100644
--- a/docs/samples/slack.md
+++ b/docs/samples/slack.md
@@ -16,8 +16,10 @@ will also tell you how to log in and how to use the GUI.
- a Slack Bot token
-_Note:_ If you don't have such a token yet, you can create your own app with
-token on [this](https://app.slack.com/apps-manage/) page.
+!!! NOTE
+
+ If you don't have such a token yet, you can create your own app with
+ token on [this](https://app.slack.com/apps-manage/) page.
### Configure the Slack sample bundle
diff --git a/docs/samples/spotify.md b/docs/samples/spotify.md
index 04ae1d8c..fb26b8d1 100644
--- a/docs/samples/spotify.md
+++ b/docs/samples/spotify.md
@@ -17,15 +17,17 @@ will also tell you how to log in and how to use the GUI.
- A Spotify account and a registered Spotify application and the associated
client id/client secret.
-_Note:_ If you don't have a registered application, yet you can follow
-[this guide](https://developer.spotify.com/documentation/general/guides/app-settings/#register-your-app).
-As a redirect URL use .
+!!! NOTE
+
+ If you don't have a registered application, yet you can follow
+ [this guide](https://developer.spotify.com/documentation/general/guides/app-settings/#register-your-app).
+ As a redirect URL use .
### Configure the Spotify sample bundle
-1. In NodeCG, create a new Spotify service instance.
+1. In NodeCG, create a new Spotify service instance.
-2. Enter your client ID and secret for Spotify:
+2. Enter your client ID and secret for Spotify:
```json
{
@@ -37,15 +39,17 @@ As a redirect URL use .
After entering it, click save.
- _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/).
+ !!! 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/).
-3. Set the sample's (`spotify-current-song`) dependency to be the newly created
- service instance (of type `spotify`).
+3. Set the sample's (`spotify-current-song`) dependency to be the newly created
+ service instance (of type `spotify`).
-4. Check the NodeCG logs:
+4. Check the NodeCG logs:
You should see an error or a success message and the current playing song
with names and artists.
diff --git a/docs/samples/sql.md b/docs/samples/sql.md
index be69b54b..6c5b5642 100644
--- a/docs/samples/sql.md
+++ b/docs/samples/sql.md
@@ -15,9 +15,11 @@ will also tell you how to log in and how to use the GUI.
- A database supported by [knex](https://knexjs.org/#Installation)
-_Note:_ If you don't have a database yet and just want to test things you can
-use sqlite3 and don't need to set up a database server. You can always move to a
-different database type later.
+!!! NOTE
+
+ If you don't have a database yet and just want to test things you can
+ use sqlite3 and don't need to set up a database server. You can always move
+ to a different database type later.
### Configure the SQL sample bundle
diff --git a/docs/samples/streamdeck.md b/docs/samples/streamdeck.md
index 92643d25..ab93a5ad 100644
--- a/docs/samples/streamdeck.md
+++ b/docs/samples/streamdeck.md
@@ -20,11 +20,11 @@ Follow the instructions listed under Manual Installation
[here](https://github.com/timothycrosley/streamdeck-ui/blob/master/README.md).
Everything after the `sudo udevadm` command can be omitted.
-### Configure the Streamdeck Rainbow bundle
+### Configure the StreamDeck Rainbow bundle
-1. In NodeCG, create a new StreamDeck service instance.
+1. In NodeCG, create a new StreamDeck service instance.
-2. Enter the configuration:
+2. Enter the configuration:
```json
{
@@ -32,10 +32,12 @@ Everything after the `sudo udevadm` command can be omitted.
}
```
- `default` tells the bundle to automatically find a StreamDeck. If you use
- multiple StreamDecks, you need to put in an ID here.
+ !!! INFO
-3. Set the sample's (`streamdeck-rainbow`) dependency to be the newly created
- service instance (of type `streamdeck`).
+ `default` tells the bundle to automatically find a StreamDeck. If you use
+ multiple StreamDecks, you need to put in an ID here.
-4. Watch your streamdeck.
+3. Set the sample's (`streamdeck-rainbow`) dependency to be the newly created
+ service instance (of type `streamdeck`).
+
+4. Watch your streamdeck.
diff --git a/docs/samples/tiane.md b/docs/samples/tiane.md
index 96ed6233..141b6852 100644
--- a/docs/samples/tiane.md
+++ b/docs/samples/tiane.md
@@ -18,9 +18,11 @@ will also tell you how to log in and how to use the GUI.
room client required)
- a Discord Bot token
-_Note:_ If you don't Discord Bot token yet, you can follow
-[this](https://discordjs.guide/preparations/setting-up-a-bot-application.html)
-guide.
+!!! NOTE
+
+ If you don't Discord Bot token yet, you can follow
+ [this](https://discordjs.guide/preparations/setting-up-a-bot-application.html)
+ guide.
### Configure the TIANE sample bundle
diff --git a/docs/samples/twitch-addons.md b/docs/samples/twitch-addons.md
index cc120db7..2c67dafe 100644
--- a/docs/samples/twitch-addons.md
+++ b/docs/samples/twitch-addons.md
@@ -16,10 +16,12 @@ will also tell you how to log in and how to use the GUI.
- A Twitch oAuth-Key
-_Note:_ If you don't have such a key yet, you can generate it on
-. Just log into your Twitch account and copy the
-token. You can also use any other token. There are no special scope requirements
-as the token is only used to convert channel names to IDs.
+!!! NOTE
+
+ If you don't have such a key yet, you can generate it on
+ . Just log into your Twitch account and copy
+ the token. You can also use any other token. There are no special scope
+ requirements as the token is only used to convert channel names to IDs.
### Configure the Twitch-Addons sample bundle
diff --git a/docs/samples/twitch-api.md b/docs/samples/twitch-api.md
index 3ef62209..14f6df81 100644
--- a/docs/samples/twitch-api.md
+++ b/docs/samples/twitch-api.md
@@ -16,10 +16,12 @@ will also tell you how to log in and how to use the GUI.
- A Twitch oAuth-Key
-_Note:_ If you don't have such a key yet, you can generate it on
-, select custom scope token and select the
-scopes you need. For this sample you don't need any additional scopes, so you
-can leave everything off.
+!!! NOTE
+
+ If you don't have such a key yet, you can generate it on
+ , select custom scope token and select
+ the scopes you need. For this sample you don't need any additional scopes,
+ so you can leave everything off.
### Configure the Twitch API sample bundle
diff --git a/docs/samples/twitch-chat.md b/docs/samples/twitch-chat.md
index b4e6b706..ed52080d 100644
--- a/docs/samples/twitch-chat.md
+++ b/docs/samples/twitch-chat.md
@@ -16,9 +16,11 @@ will also tell you how to log in and how to use the GUI.
- a Twitch oAuth-Key
-_Note:_ If you don't have such a key yet, you can generate it on
-. Just log into your Twitch account and copy the
-token.
+!!! NOTE
+
+ If you don't have such a key yet, you can generate it on
+ . Just log into your Twitch account and copy
+ the token.
### Configure the Twitch sample bundle
diff --git a/docs/samples/twitch-pubsub.md b/docs/samples/twitch-pubsub.md
index 974143ef..372ec0b0 100644
--- a/docs/samples/twitch-pubsub.md
+++ b/docs/samples/twitch-pubsub.md
@@ -15,9 +15,11 @@ will also tell you how to log in and how to use the GUI.
- A Twitch oAuth-Key
-_Note:_ If you don't have such a key yet, you can generate it on
-, select custom scope token and select these
-scopes: `channel_subscriptions`, `bits:read` and `channel:read:redemptions`
+!!! NOTE
+
+ If you don't have such a key yet, you can generate it on
+ , select custom scope token and select these
+ scopes: `channel_subscriptions`, `bits:read` and `channel:read:redemptions`
### Configure the Twitch PubSub sample bundle
diff --git a/docs/samples/twitter.md b/docs/samples/twitter.md
index 159b9c1c..b8f86e3f 100644
--- a/docs/samples/twitter.md
+++ b/docs/samples/twitter.md
@@ -20,9 +20,11 @@ will also tell you how to log in and how to use the GUI.
- The _Access token_ here **oauthToken**
- The _Access token secret_ here **oauthTokenSecret**
-_Note:_ You will need a Twitter developer account
-() to get the necessary keys
-and tokens.
+!!! NOTE
+
+ You will need a Twitter developer account
+ () to get the necessary keys
+ and tokens.
### Configure the sample bundle
diff --git a/docs/samples/xdotool.md b/docs/samples/xdotool.md
index 2c53afb9..b5c9d652 100644
--- a/docs/samples/xdotool.md
+++ b/docs/samples/xdotool.md
@@ -5,6 +5,10 @@ the xdotool service to execute
[xdotool commands](http://manpages.ubuntu.com/manpages/trusty/man1/xdotool.1.html)
by minimizing the currently active window.
+!!! ATTENTION
+
+ Only works on Linux
+
### Prerequisites
You will need a working `nodecg-io` installation. If you have non yet take a
@@ -13,7 +17,7 @@ install this bundle, so take a look at the
[“Try an included sample”](../getting_started/try_example_bundle.md)-Guide. It
will also tell you how to log in and how to use the GUI.
-- Xdotool installed (Only works on Linux)
+- Xdotool installed
### Configure the Xdotool sample bundle
diff --git a/docs/samples/youtube.md b/docs/samples/youtube.md
index 4af41a98..29b472f8 100644
--- a/docs/samples/youtube.md
+++ b/docs/samples/youtube.md
@@ -16,17 +16,21 @@ will also tell you how to log in and how to use the GUI.
- Google cloud API OAuth access (client ID, client Secret)
- Grant `YouTube Data API v3` access at the project's dashboard.
- Shortcut URL:
- >
+ `https://console.developers.google.com/apis/library/youtube.googleapis.com?project=`.
-_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 .
+!!! 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:
+
+
### Configure the YouTube sample bundle
-1. In NodeCG, create a new googleapis service instance.
+1. In NodeCG, create a new googleapis service instance.
-2. Enter your YouTube OAuth credentials:
+2. Enter your YouTube OAuth credentials:
```json
{
@@ -38,13 +42,15 @@ As redirect URI add .
After entering it, click save.
- _Note:_ You can add multiple scopes if the googleapis instance is used for
- multiple bundles.
+ !!! NOTE
+
+ You can add multiple scopes if the googleapis instance is used for
+ multiple bundles.
-3. Set the sample's (`youtube-playlist`) dependency to be the newly created
- service instance (of type `googleapis`).
+3. Set the sample's (`youtube-playlist`) dependency to be the newly created
+ service instance (of type `googleapis`).
-4. Check the NodeCG logs:
+4. Check the NodeCG logs:
You should see an error or a success message that is hardcoded in
`samples/youtube-playlist/extension/index.ts`.
diff --git a/docs/stylesheets/colors.css b/docs/stylesheets/colors.css
index 0b32848b..6f34a4b9 100644
--- a/docs/stylesheets/colors.css
+++ b/docs/stylesheets/colors.css
@@ -19,3 +19,7 @@
.md-typeset .task-list-control [type="checkbox"]:checked + .task-list-indicator::before {
background: var(--md-primary-fg-color) !important;
}
+
+.md-typeset pre > code {
+ white-space: pre-wrap;
+}
diff --git a/mkdocs.yml b/mkdocs.yml
index 4c30b4d0..e3e2a279 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -33,6 +33,7 @@ markdown_extensions:
- pymdownx.tabbed
- pymdownx.tasklist:
custom_checkbox: true
+ - admonition
nav:
- Home: index.md
@@ -46,7 +47,10 @@ nav:
- Basics: contribute/contribute.md
- Create a Service: contribute/create_service.md
- Create a sample bundle: contribute/create_sample.md
- - Document a sample: contribute/sample_documentation.md
+ - Documentation:
+ - Setup: contribute/docs_setup.md
+ - Markdown: contribute/docs_markdown.md
+ - Document a sample: contribute/docs_sample.md
- Contributors: contribute/contributors.md
- Services:
- Available services: services.md
diff --git a/package.json b/package.json
index e8cebc29..7a5e7943 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"compatibleRange": "^1.1.1"
},
"scripts": {
- "lint": "markdownlint -p ./.ignore-files.txt .",
- "format": "prettier -w --ignore-path ./.ignore-files.txt **.md"
+ "lint": "markdownlint -p .prettierignore .",
+ "format": "prettier -w **.md"
}
}