Skip to content

Commit

Permalink
refactor(docs): Use .mdx for docs with mdx features
Browse files Browse the repository at this point in the history
Also applies prettier changes in touched files due to precommit
  • Loading branch information
caksoylar committed Jan 13, 2024
1 parent 32c4c33 commit 45203a5
Show file tree
Hide file tree
Showing 30 changed files with 165 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ author_image_url: https://avatars.githubusercontent.com/u/7876996
tags: [keyboards, firmware, community]
---

import ThemedImage from '@theme/ThemedImage';
import ThemedImage from "@theme/ThemedImage";

<ThemedImage
alt="Shows a screenshot of the Keymap Editor application featuring a graphical layout of the Corne Keyboard with a keymap loaded from the nickcoutsos/keymap-editor-demo-crkbd GitHub repository."
sources={{
light: require('./assets/2023-11-09-keymap-editor/editor-screenshot-light.png').default,
dark: require('./assets/2023-11-09-keymap-editor/editor-screenshot-dark.png').default,
alt="Shows a screenshot of the Keymap Editor application featuring a graphical layout of the Corne Keyboard with a keymap loaded from the nickcoutsos/keymap-editor-demo-crkbd GitHub repository."
sources={{
light:
require("./assets/2023-11-09-keymap-editor/editor-screenshot-light.png")
.default,
dark: require("./assets/2023-11-09-keymap-editor/editor-screenshot-dark.png")
.default,
}}
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/behaviors/backlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: Backlight

## Summary

This page contains [backlight](../features/backlight.md) behaviors supported by ZMK.
This page contains [backlight](../features/backlight.mdx) behaviors supported by ZMK.

## Backlight Action Defines

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/behaviors/bluetooth.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ Please note there are five available Bluetooth profiles by default. If you need
:::

:::note
If you clear bond of a paired profile, make sure you do the same thing on the peer device as well (typically achieved by _removing_ or _forgetting_ the bluetooth connection). Otherwise the peer will try to connect to your keyboard whenever it discovers it. But while the MAC address of both devices could remain the same, the security key no longer match: the peer device still possess the old key negotiated in the previous pairing procedure, but our keyboard firmware has deleted that key. So the connection will fail. If you [enabled USB logging](../development/usb-logging.md), you might see a lot of failed connection attempts due to the reason of “Security failed”.
If you clear bond of a paired profile, make sure you do the same thing on the peer device as well (typically achieved by _removing_ or _forgetting_ the bluetooth connection). Otherwise the peer will try to connect to your keyboard whenever it discovers it. But while the MAC address of both devices could remain the same, the security key no longer match: the peer device still possess the old key negotiated in the previous pairing procedure, but our keyboard firmware has deleted that key. So the connection will fail. If you [enabled USB logging](../development/usb-logging.mdx), you might see a lot of failed connection attempts due to the reason of “Security failed”.
:::
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: Hold-Tap Behavior
sidebar_label: Hold-Tap
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## Summary

Expand Down Expand Up @@ -132,7 +132,7 @@ the hold-tap. For homerow mods, this is not always ideal, because it prevents co

#### Using different behavior types with hold-taps

You can create instances of hold-taps invoking most [behavior types](../features/keymaps.md#behaviors) for hold or tap actions, by referencing their node labels in the `bindings` value.
You can create instances of hold-taps invoking most [behavior types](../features/keymaps.mdx#behaviors) for hold or tap actions, by referencing their node labels in the `bindings` value.
The two parameters that are passed to the hold-tap in your keymap will be forwarded to the referred behaviors, first one to the hold behavior and second one to the tap.

If you use behaviors that accept no parameters such as [mod-morphs](mod-morph.md) or [macros](macros.md), you can pass a dummy parameter value such as `0` to the hold-tap when you use it in your keymap.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/behaviors/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Example:

### Configuration

You can configure a different tapping term or tweak other properties noted in the [hold-tap](hold-tap.md#advanced-configuration) documentation page in your keymap:
You can configure a different tapping term or tweak other properties noted in the [hold-tap](hold-tap.mdx#advanced-configuration) documentation page in your keymap:

```dts
&lt {
Expand All @@ -74,11 +74,11 @@ You can configure a different tapping term or tweak other properties noted in th
```

:::info
Functionally, the layer-tap is a [hold-tap](hold-tap.md) of the ["tap-preferred" flavor](hold-tap.md/#flavors) and a [`tapping-term-ms`](hold-tap.md/#tapping-term-ms) of 200 that takes in a [`momentary layer`](#momentary-layer) and a [keypress](key-press.md) as its "hold" and "tap" parameters, respectively.
Functionally, the layer-tap is a [hold-tap](hold-tap.mdx) of the ["tap-preferred" flavor](hold-tap.mdx/#flavors) and a [`tapping-term-ms`](hold-tap.mdx/#tapping-term-ms) of 200 that takes in a [`momentary layer`](#momentary-layer) and a [keypress](key-press.md) as its "hold" and "tap" parameters, respectively.

For users who want to send a different [keycode](../codes/index.mdx) depending on if the same key is held or tapped, see [Mod-Tap](mod-tap.md).

Similarly, for users looking to create a keybind like the layer-tap that depending on how long the key is held, invokes behaviors like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.md).
Similarly, for users looking to create a keybind like the layer-tap that depending on how long the key is held, invokes behaviors like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.mdx).

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/behaviors/mod-tap.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ You can configure a different tapping term in your keymap:
```

:::info
Under the hood, the mod-tap is simply a [hold-tap](hold-tap.md) of the ["hold-preferred" flavor](hold-tap.md/#flavors) with a [`tapping-term-ms`](hold-tap.md/#tapping-term-ms) of 200 that takes in two [keypresses](key-press.md) as its "hold" and "tap" parameters. This means that the mod-tap can be used to invoke **any** [keycode](../codes/index.mdx), and is not limited to only activating [modifier keys](../codes/modifiers.mdx) when it is held.
Under the hood, the mod-tap is simply a [hold-tap](hold-tap.mdx) of the ["hold-preferred" flavor](hold-tap.mdx/#flavors) with a [`tapping-term-ms`](hold-tap.mdx/#tapping-term-ms) of 200 that takes in two [keypresses](key-press.md) as its "hold" and "tap" parameters. This means that the mod-tap can be used to invoke **any** [keycode](../codes/index.mdx), and is not limited to only activating [modifier keys](../codes/modifiers.mdx) when it is held.

For users who want to momentarily access a specific [layer](../features/keymaps#layers) while a key is held and send a keycode when the same key is tapped, see [Layer-Tap](layers.md/#layer-tap).

Similarly, for users looking to create a keybind like the mod-tap that invokes behaviors _other_ than [keypresses](key-press.md), like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.md).
Similarly, for users looking to create a keybind like the mod-tap that invokes behaviors _other_ than [keypresses](key-press.md), like [sticky keys](sticky-key.md) or [key toggles](key-toggle.md), see [Hold-Tap](hold-tap.mdx).

:::
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: Tap-Dance Behavior
sidebar_label: Tap-Dance
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## Summary

Expand All @@ -20,7 +20,7 @@ Defines the maximum elapsed time after the last tap-dance keybind press before a

#### `bindings`

An array of one or more keybinds. This list can include [any ZMK keycode](../codes/) and any listed ZMK behavior, like [hold-taps](hold-tap.md), or [sticky keys](sticky-key.md). The index of a keybind in the `bindings` array corresponds to the number of times the tap-dance binding is pressed. For example, in the [basic tap-dance counter](#basic-example-counter) shown below, `&kp N2` is the second binding in the array of `bindings`: we then see an output of `2` when the `td0` binding is pressed twice.
An array of one or more keybinds. This list can include [any ZMK keycode](../codes/) and any listed ZMK behavior, like [hold-taps](hold-tap.mdx), or [sticky keys](sticky-key.md). The index of a keybind in the `bindings` array corresponds to the number of times the tap-dance binding is pressed. For example, in the [basic tap-dance counter](#basic-example-counter) shown below, `&kp N2` is the second binding in the array of `bindings`: we then see an output of `2` when the `td0` binding is pressed twice.

The number of bindings in this array also determines the tap-dance's maximum number of keypresses. When a tap-dance reaches its maximum number of keypresses, it will immediately invoke the last behavior in its list of `bindings`, rather than waiting for [`tapping-term-ms`](#tapping-term-ms) to expire before the output is displayed.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/config/backlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Backlight Configuration
sidebar_label: Backlight
---

See the [backlight feature page](../features/backlight.md) for more details, including instructions for adding backlight support to a board.
See the [backlight feature page](../features/backlight.mdx) for more details, including instructions for adding backlight support to a board.

See [Configuration Overview](index.md) for instructions on how to change these settings.

Expand Down Expand Up @@ -37,4 +37,4 @@ See the Zephyr devicetree bindings for LED drivers:
- [gpio-leds](https://docs.zephyrproject.org/3.0.0/reference/devicetree/bindings/gpio/gpio-leds.html)
- [pwm-leds](https://docs.zephyrproject.org/latest/build/dts/api/bindings/led/pwm-leds.html)

See the [backlight feature page](../features/backlight.md) for examples of the properties that must be set to enable backlighting.
See the [backlight feature page](../features/backlight.mdx) for examples of the properties that must be set to enable backlighting.
6 changes: 3 additions & 3 deletions docs/docs/config/behaviors.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can use the following nodes to tweak the default behaviors:

Creates a custom behavior that triggers one behavior when a key is held or a different one when the key is tapped.

See the [hold-tap behavior](../behaviors/hold-tap.md) documentation for more details and examples.
See the [hold-tap behavior](../behaviors/hold-tap.mdx) documentation for more details and examples.

### Devicetree

Expand Down Expand Up @@ -77,7 +77,7 @@ The `flavor` property may be one of:
- `"tap-preferred"`
- `"tap-unless-interrupted"`

See the [hold-tap behavior documentation](../behaviors/hold-tap.md) for an explanation of each flavor.
See the [hold-tap behavior documentation](../behaviors/hold-tap.mdx) for an explanation of each flavor.

`hold-trigger-key-positions` is an array of zero-based key position indices.

Expand Down Expand Up @@ -243,7 +243,7 @@ You can use the following nodes to tweak the default behaviors:

Creates a custom behavior that triggers a different behavior corresponding to the number of times the key is tapped.

See the [tap dance behavior](../behaviors/tap-dance.md) documentation for more details and examples.
See the [tap dance behavior](../behaviors/tap-dance.mdx) documentation for more details and examples.

### Devicetree

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/config/combos.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Each child node can have the following properties:

| Property | Type | Description | Default |
| ----------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| `bindings` | phandle-array | A [behavior](../features/keymaps.md#behaviors) to run when the combo is triggered | |
| `bindings` | phandle-array | A [behavior](../features/keymaps.mdx#behaviors) to run when the combo is triggered | |
| `key-positions` | array | A list of key position indices for the keys which should trigger the combo | |
| `timeout-ms` | int | All the keys in `key-positions` must be pressed within this time in milliseconds to trigger the combo | 50 |
| `require-prior-idle-ms` | int | If any non-modifier key is pressed within `require-prior-idle-ms` before a key in the combo, the key will not be considered for the combo | -1 (disabled) |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ZMK will search the shield folder for the following config files:

Shared config files (excluding any `_left` or `_right` suffix) are not currently supported in shield folders.

For more documentation on creating and configuring a new shield, see [Zephyr's shield documentation](https://docs.zephyrproject.org/latest/hardware/porting/shields.html) and [ZMK's new keyboard shield](../development/new-shield.md) guide.
For more documentation on creating and configuring a new shield, see [Zephyr's shield documentation](https://docs.zephyrproject.org/latest/hardware/porting/shields.html) and [ZMK's new keyboard shield](../development/new-shield.mdx) guide.

## Kconfig Files

Expand Down
10 changes: 5 additions & 5 deletions docs/docs/config/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ The `zmk,keymap` node itself has no properties. It should have one child node pe

Each child node can have the following properties:

| Property | Type | Description |
| ----------------- | ------------- | ---------------------------------------------------------------------- |
| `display-name` | string | Name for the layer on displays |
| `bindings` | phandle-array | List of [key behaviors](../features/keymaps.md#behaviors), one per key |
| `sensor-bindings` | phandle-array | List of sensor behaviors, one per sensor |
| Property | Type | Description |
| ----------------- | ------------- | ----------------------------------------------------------------------- |
| `display-name` | string | Name for the layer on displays |
| `bindings` | phandle-array | List of [key behaviors](../features/keymaps.mdx#behaviors), one per key |
| `sensor-bindings` | phandle-array | List of sensor behaviors, one per sensor |

Items for `bindings` must be listed in the order the keys are defined in the [keyboard scan configuration](kscan.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/config/kscan.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Transforms should be used any time the physical layout of a keyboard's keys does

Transforms can also be used for keyboards with multiple layouts. You can define multiple matrix transform nodes, one for each layout, and users can select which one they want from the `/chosen` node in their keymaps.

See the [new shield guide](../development/new-shield.md#optional-matrix-transform) for more documentation on how to define a matrix transform.
See the [new shield guide](../development/new-shield.mdx#optional-matrix-transform) for more documentation on how to define a matrix transform.

### Devicetree

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_label: Customizing ZMK
---

After verifying you can successfully flash the default firmware, you will probably want to begin customizing your keymap and other keyboard options.
[In the initial setup tutorial](user-setup.md), you created a Github repository called `zmk-config`. This repository is a discrete filesystem which works
[In the initial setup tutorial](user-setup.mdx), you created a Github repository called `zmk-config`. This repository is a discrete filesystem which works
with the main `zmk` firmware repository to build your desired firmware. The main advantage of a discrete configuration folder is ensuring that the
working components of ZMK are kept separate from your personal keyboard settings, reducing the amount of file manipulation in the configuration process.
This makes flashing ZMK to your keyboard much easier, especially because you don't need to keep an up-to-date copy of zmk on your computer at all times.
Expand All @@ -28,7 +28,7 @@ Refer to the [Configuration](/docs/config) documentation for more details on thi
## Keymap

Once you have the basic user config completed, you can find the keymap file in `config/<keyboard>.keymap` and customize from there.
Refer to the [Keymap](features/keymaps.md) documentation to learn more.
Refer to the [Keymap](features/keymaps.mdx) documentation to learn more.

## Publishing

Expand All @@ -40,9 +40,9 @@ If you need to, a review of [Learn The Basics Of Git In Under 10 Minutes](https:
:::

:::note
It is also possible to build firmware locally on your computer by following the [toolchain setup](development/setup.md) and
[building instructions](development/build-flash.md), which includes pointers to
[building using your `zmk-config` folder](development/build-flash.md#building-from-zmk-config-folder).
It is also possible to build firmware locally on your computer by following the [toolchain setup](development/setup.mdx) and
[building instructions](development/build-flash.mdx), which includes pointers to
[building using your `zmk-config` folder](development/build-flash.mdx#building-from-zmk-config-folder).
:::

## Flashing Your Changes
Expand All @@ -54,7 +54,7 @@ More troubleshooting information for split keyboards can be found [here](trouble

## Building Additional Keyboards

You can build additional keyboards with GitHub actions by appending them to `build.yml` in your `zmk-config` folder. For instance assume that we have set up a Corne shield with nice!nano during [initial setup](user-setup.md) and we want to add a Lily58 shield with nice!nano v2. The following is an example `build.yaml` file that would accomplish that:
You can build additional keyboards with GitHub actions by appending them to `build.yml` in your `zmk-config` folder. For instance assume that we have set up a Corne shield with nice!nano during [initial setup](user-setup.mdx) and we want to add a Lily58 shield with nice!nano v2. The following is an example `build.yaml` file that would accomplish that:

```yaml
include:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@ title: Building and Flashing
sidebar_label: Building and Flashing
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

export const OsTabs = (props) => (<Tabs
groupId="operating-systems"
defaultValue="debian"
values={[
{label: 'Debian/Ubuntu', value: 'debian'},
{label: 'Raspberry OS', value: 'raspberryos'},
{label: 'Fedora', value: 'fedora'},
{label: 'Windows', value: 'win'},
{label: 'macOS', value: 'mac'},
]
}>{props.children}</Tabs>);
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

export const OsTabs = (props) => (
<Tabs
groupId="operating-systems"
defaultValue="debian"
values={[
{ label: "Debian/Ubuntu", value: "debian" },
{ label: "Raspberry OS", value: "raspberryos" },
{ label: "Fedora", value: "fedora" },
{ label: "Windows", value: "win" },
{ label: "macOS", value: "mac" },
]}
>
{props.children}
</Tabs>
);

## Building

Expand Down Expand Up @@ -110,7 +114,7 @@ west build -b nice_nano_v2 -- -DSHIELD=vendor_shield -DZMK_EXTRA_MODULES="C:/Use

### Building from `zmk-config` Folder

Instead of building .uf2 files using the default keymap and config files, you can build directly from your [`zmk-config` folder](../user-setup.md#github-repo) by adding
Instead of building .uf2 files using the default keymap and config files, you can build directly from your [`zmk-config` folder](../user-setup.mdx#github-repo) by adding
`-DZMK_CONFIG="C:/the/absolute/path/config"` to your `west build` command. **Notice that this path should point to the folder labelled `config` within your `zmk-config` folder.**

For instance, building kyria firmware from a user `myUser`'s `zmk-config` folder on Windows 10 may look something like this:
Expand Down
Loading

0 comments on commit 45203a5

Please sign in to comment.