Skip to content

Commit

Permalink
Fix expander formatting bug (#3097)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessamyT authored Jul 2, 2024
1 parent bf007e3 commit 44d14f9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
28 changes: 14 additions & 14 deletions docs/fleet/fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
5. Add any update operators you'd like to apply to the fragment to the `mods` section.
Click to view each example:

{{%expand "Change the name and attributes of a component" %}}
{{< expand "Change the name and attributes of a component" >}}
This example uses [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/#mongodb-update-up.-set) to make the following changes to the attributes of a motor named `motor1`:

- Sets the `max_rpm` to `1818`.
Expand All @@ -193,8 +193,8 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
],
```

{{% /expand%}}
{{%expand "Remove an attribute" %}}
{{< /expand >}}
{{< expand "Remove an attribute" >}}
This example uses [`$unset`](https://www.mongodb.com/docs/manual/reference/operator/update/unset/#mongodb-update-up.-unset) to remove the pin number set for the `pwm` pin, so the motor no longer has a PWM pin set.
In other words, it deletes the `pwm` pin field.

Expand All @@ -213,8 +213,8 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
],
```

{{% /expand%}}
{{%expand "Modify dependencies" %}}
{{< /expand >}}
{{< expand "Modify dependencies" >}}
This example uses [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/#mongodb-update-up.-set) to assign a new list of dependencies to a component named `rover_base2`.

```json {class="line-numbers linkable-line-numbers"}
Expand All @@ -232,8 +232,8 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
],
```

{{% /expand%}}
{{%expand "Change motor pins from A and B to PWM and DIR" %}}
{{< /expand >}}
{{< expand "Change motor pins from A and B to PWM and DIR" >}}
This example uses [`$rename`](https://www.mongodb.com/docs/manual/reference/operator/update/rename/) to make the following changes to the attributes of a motor named `motor1` in the fragment:

- Retrieves the pin number for pin `a` and assigns that value to the PWM pin.
Expand All @@ -260,8 +260,8 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
],
```

{{% /expand%}}
{{%expand "Change a camera path" %}}
{{< /expand >}}
{{< expand "Change a camera path" >}}
This example uses [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/#mongodb-update-up.-set) to change the video path for a camera named `camera-one` in the fragment:

```json {class="line-numbers linkable-line-numbers"}
Expand All @@ -279,8 +279,8 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
],
```

{{% /expand%}}
{{%expand "Modify data sync settings" %}}
{{< /expand >}}
{{< expand "Modify data sync settings" >}}
This example uses [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/#mongodb-update-up.-set) to change the sync interval for a [data management service](/services/data/) named `data-management` in the fragment:

```json {class="line-numbers linkable-line-numbers"}
Expand All @@ -298,8 +298,8 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
],
```

{{% /expand%}}
{{%expand "Pin a module version" %}}
{{< /expand >}}
{{< expand "Pin a module version" >}}
This example uses [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/#mongodb-update-up.-set) to set [version update settings for a module](/registry/configure/#edit-the-configuration-of-a-module-from-the-viam-registry) named `custom-sensor` in the fragment:

```json {class="line-numbers linkable-line-numbers"}
Expand All @@ -324,7 +324,7 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
- To always update with the latest release, use `"latest"`
- To pin to a specific release, use `"<version number>"`, for example `"1.8.3"`

{{% /expand%}}
{{< /expand >}}

6. Click **Save** in the upper right corner of the page to save your new configuration.
7. To check that your mods are working, view your machine's debug configuration.
Expand Down
34 changes: 17 additions & 17 deletions docs/registry/upload/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ If you later wish to make your module public, you can use the [`viam module upda
For example, the following represents the configuration of an example `my-module` public module in the `acme` namespace:
{{%expand "Click to view example meta.json with build object" %}}
{{< expand "Click to view example meta.json with build object" >}}
```json {class="line-numbers linkable-line-numbers"}
{
Expand All @@ -156,9 +156,9 @@ If you later wish to make your module public, you can use the [`viam module upda
}
```
{{% /expand%}}
{{< /expand >}}
{{%expand "Click to view example meta.json without build object" %}}
{{< expand "Click to view example meta.json without build object" >}}
```json {class="line-numbers linkable-line-numbers"}
{
Expand All @@ -176,7 +176,7 @@ If you later wish to make your module public, you can use the [`viam module upda
}
```
{{% /expand%}}
{{< /expand >}}
{{% alert title="Important" color="note" %}}
Expand All @@ -197,18 +197,18 @@ For more information, see [Naming your model](/registry/#naming-your-model-names
tar -czvf dist/archive.tar.gz <PATH-TO-EXECUTABLE>
```

Where `<PATH-TO-EXECUTABLE>` is the [packaged executable](/registry/create/#compile-or-package-your-module) that runs the module at the [entry point](/registry/create/#write-an-entry-point-main-program-file).
If using PyInstaller, by default this would be `dist/main`.
where `<PATH-TO-EXECUTABLE>` is the [packaged executable](/registry/create/#compile-or-package-your-module) that runs the module at the [entry point](/registry/create/#write-an-entry-point-main-program-file).
If using PyInstaller, by default this would be `dist/main`.

For a Python module built using the `venv` approach, the command might look like this:
For a Python module built using the `venv` approach, the command might look like this:

```sh {id="terminal-prompt" class="command-line" data-prompt="$"}
tar -czf module.tar.gz run.sh requirements.txt src
```
```sh {id="terminal-prompt" class="command-line" data-prompt="$"}
tar -czf module.tar.gz run.sh requirements.txt src
```

Where `run.sh` is your [entrypoint file](/registry/create/#compile-or-package-your-module), `requirements.txt` is your [pip dependency list file](/registry/create/#compile-or-package-your-module), and `src` is the directory that contains the source code of your module.
Where `run.sh` is your [entrypoint file](/registry/create/#compile-or-package-your-module), `requirements.txt` is your [pip dependency list file](/registry/create/#compile-or-package-your-module), and `src` is the directory that contains the source code of your module.

Supply the path to the resulting archive file in the next step.
Supply the path to the resulting archive file in the next step.

1. Run `viam module upload` to upload your custom module to the Viam registry.
Specify the path to the file, directory, or compressed archive (with `.tar.gz` or `.tgz` extension) that contains your custom module code:
Expand All @@ -217,7 +217,7 @@ Supply the path to the resulting archive file in the next step.
viam module upload --version <version> --platform <platform> <module-path>
```

Where:
where:

- `version`: provide a version for your custom module, using [semantic versioning](https://semver.org/) (example: `1.0.0`).
You can later increment this value with subsequent `viam module upload` commands.
Expand Down Expand Up @@ -254,9 +254,9 @@ Supply the path to the resulting archive file in the next step.
viam module upload --version 1.0.0 --platform linux/amd64 packaged-module.tar.gz
```

When you `upload` a module, the command performs basic [validation](/cli/#upload-validation) of your module to check for common errors.
When you `upload` a module, the command performs basic [validation](/cli/#upload-validation) of your module to check for common errors.

For more information, see the [`viam module` command](/cli/#module)
For more information, see the [`viam module` command](/cli/#module).

## Update an existing module

Expand Down Expand Up @@ -311,7 +311,7 @@ If you intend to make frequent code changes to your module, want to support a va

When you `upload` a module, the command performs basic [validation](/cli/#upload-validation) of your module to check for common errors.

For more information, see the [`viam module` command](/cli/#module)
For more information, see the [`viam module` command](/cli/#module).

### Update an existing module using a GitHub action

Expand Down Expand Up @@ -554,7 +554,7 @@ For more details, see the [`upload-module` GitHub Action documentation](https://
{{% /tab %}}
{{< /tabs >}}

1. Create an [organization API key](/cli/#create-an-organization-api-key) with the [owner](/cloud/rbac/#permissions) role, which the GitHub action will use to authenticate to the Viam platform, using one of the following methods:
4. Create an [organization API key](/cli/#create-an-organization-api-key) with the [owner](/cloud/rbac/#permissions) role, which the GitHub action will use to authenticate to the Viam platform, using one of the following methods:

- Use the Viam CLI to create an organization API key, which includes the owner role by default:

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/control/air-quality-fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ For each machine:

If you do not see readings, check the **LOGS** tab for errors, double-check that serial communication is enabled on the singe board computer, and check that the `usb_interface` path is correctly specified (click below).

{{%expand "Click here for usb_interface troubleshooting help" %}}
{{< expand "Click here for usb_interface troubleshooting help" >}}

If you only have one USB device plugged into each of your boards, the `usb_interface` value you configured in the sensor config is likely (conveniently) the same for all of your machines.
If not, you can use [fragment mods](/fleet/fragments/#use-fragment_mods) to modify the value on any machine for which it is different:
Expand Down Expand Up @@ -340,7 +340,7 @@ If not, you can use [fragment mods](/fleet/fragments/#use-fragment_mods) to modi
If you have lots of machines with one `usb_interface` value, and lots of machines with a second one, you might consider duplicating the fragment, editing that value, and using that second fragment instead of the first one for the applicable machines, rather than using a fragment mod for each of the machines.
You have options.

{{% /expand%}}
{{< /expand >}}

## Test data sync

Expand Down

0 comments on commit 44d14f9

Please sign in to comment.