Skip to content

Commit d2eb6de

Browse files
authored
docs: Add query strings to tabs (#2840)
1 parent 209085d commit d2eb6de

File tree

16 files changed

+62
-18
lines changed

16 files changed

+62
-18
lines changed

Diff for: docs/docs/development/hardware-integration/dongle.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ If your keyboard is not Studio-ready or you have no interest in using ZMK Studio
146146

147147
<Tabs
148148
groupId="studio-ready"
149+
queryString
149150
defaultValue="studio"
150151
values={[
151152
{ label: "Dongle with Studio", value: "studio" },
@@ -164,6 +165,7 @@ There are three commonly found possibilities:
164165

165166
<Tabs
166167
groupId="layout-locations"
168+
queryString
167169
defaultValue="layouts"
168170
values={[
169171
{ label: "Layouts File", value: "layouts" },

Diff for: docs/docs/development/hardware-integration/index.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ In ZMK, these have no shield, only a board.
5858
## Organization Overview
5959

6060
<Tabs
61+
queryString="keyboard-type"
6162
defaultValue="self-contained"
6263
values={[
6364
{label: 'Self-contained keyboards', value: 'self-contained'},

Diff for: docs/docs/development/hardware-integration/lighting/backlight.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ Please see [lighting feature page](../../../features/lighting.md#backlight) for
1111

1212
<Tabs
1313
defaultValue="shieldpin"
14+
queryString="part-type"
1415
values={[
15-
{label: 'Adding to a board', value: 'boardpin'},{label: 'Adding to a shield', value: 'shieldpin'},
16+
{label: 'Adding to a board', value: 'boardpin'}, {label: 'Adding to a shield', value: 'shieldpin'},
1617
]}>
1718

1819
<TabItem value="boardpin">

Diff for: docs/docs/development/hardware-integration/new-shield.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Metadata from "@site/src/data/hardware-metadata.json";
1010
export const SplitTabs = (props) => (
1111
<Tabs
1212
groupId="keyboard-type"
13+
queryString
1314
defaultValue="unibody"
1415
values={[
1516
{ label: "Unibody Keyboard", value: "unibody" },
@@ -25,6 +26,7 @@ export const SplitTabs = (props) => (
2526
export const SplitInvisTabs = (props) => (
2627
<Tabs
2728
groupId="keyboard-type"
29+
queryString
2830
defaultValue="unibody"
2931
className="secrettabs"
3032
values={[
@@ -450,7 +452,7 @@ Also see the [matrix transform section](../../config/layout.md#matrix-transform)
450452
Your keyboard will need to have a physical layout defined.
451453
Physical layouts organize the matrix transform, kscan and optionally the physical description of key positions in a single entity.
452454

453-
<Tabs groupId="physical-layouts" defaultValue="basic">
455+
<Tabs groupId="physical-layouts" queryString defaultValue="basic">
454456
<TabItem value="basic" label="Basic">
455457

456458
If you are not planning to add support for [ZMK Studio](../../features/studio.md), you can add a `zmk,physical-layout`-compatible node for each physical layout your keyboard supports:

Diff for: docs/docs/development/hardware-integration/pinctrl.mdx

+5-1
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ All of your configuration will happen by adjusting the `pinctrl` node. Changes a
110110
Within said node, you will configure one or more child nodes for the buses. You will want to define the child nodes according to the instructions in the `pinctrl.yaml` file.
111111
The child nodes that you define should be named appropriately. The common naming schema is `usageNumber_state`. For example, `uart0_default`.
112112

113-
Child nodes are (generally, there are[exceptions](https://docs.zephyrproject.org/3.5.0/hardware/pinctrl/index.html#pin-configuration)) expected to contain one or more subnodes typically named "groupX". These are for grouping together pins that should be assigned the same state, such as enabling an internal pull-up.
113+
Child nodes are (generally, there are [exceptions](https://docs.zephyrproject.org/3.5.0/hardware/pinctrl/index.html#pin-configuration)) expected to contain one or more subnodes typically named "groupX". These are for grouping together pins that should be assigned the same state, such as enabling an internal pull-up.
114114
Below are some examples of SPI child nodes for the nRF52840 and the RP2040. Further examples are contained within the comments of the respecting `pinctrl.yaml` files.
115115

116116
<Tabs
117+
groupId="controller-type"
118+
queryString
117119
defaultValue="nrf52840"
118120
values={[
119121
{label: 'nRF52840', value: 'nrf52840'},
@@ -223,6 +225,8 @@ You'll want to identify the correct node for you to be changing. The nRF52840 ha
223225
Adjust the node like so:
224226
225227
<Tabs
228+
groupId="controller-type"
229+
queryString
226230
defaultValue="nrf52840"
227231
values={[
228232
{label: 'nRF52840', value: 'nrf52840'},

Diff for: docs/docs/development/hardware-integration/pointing.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The configuration details will thus vary depending on if you are adding a pointi
1515
export const SplitTabs = (props) => (
1616
<Tabs
1717
groupId="part-type"
18+
queryString
1819
defaultValue="unibody"
1920
values={[
2021
{ label: "Unibody", value: "unibody" },

Diff for: docs/docs/development/hardware-integration/soft-off-setup.mdx

+24-9
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import SidebandWakeupDirect from "./includes/_sideband-wakeup-direct.md";
1818

1919
Advanced methods of adding [soft off](../../features/low-power-states.md#soft-off) to a keyboard are detailed below. The first two tabs describe methods involving hardware changes, while the last describes the firmware changes necessary to define a single specific key switch for waking up.
2020

21-
<Tabs groupId="advanced-methods" defaultValue="direct">
21+
<Tabs groupId="advanced-methods" queryString defaultValue="direct">
2222
<TabItem value="direct" label="Direct Pin"></TabItem>
2323
<TabItem value="matrix" label="Matrix Integrated Pin"></TabItem>
2424
<TabItem value="wakeup" label="Wakeup-only Key Switch">
2525
The exact method of reusing a key switch to wake from the soft off state
2626
differs depending on whether said key switch is part of a direct GPIO kscan
2727
or part of a matrix kscan.
28-
<Tabs groupId="kscan-type" defaultValue="mkscan">
28+
<Tabs groupId="kscan-type" queryString defaultValue="mkscan">
2929
<TabItem value="dkscan" label="Direct GPIO kscan"></TabItem>
3030
<TabItem value="mkscan" label="Matrix kscan"></TabItem>
3131
</Tabs>
@@ -34,7 +34,7 @@ Advanced methods of adding [soft off](../../features/low-power-states.md#soft-of
3434

3535
## Hardware Changes
3636

37-
<Tabs groupId="advanced-methods" defaultValue="direct" className="secrettabs">
37+
<Tabs groupId="advanced-methods" queryString defaultValue="direct" className="secrettabs">
3838
<TabItem value="direct" label="Direct Pin">
3939

4040
Add a direct push button between a GPIO pin and ground. This button will act as an on/off switch.
@@ -57,7 +57,7 @@ Advanced methods of adding [soft off](../../features/low-power-states.md#soft-of
5757

5858
Several items work together to make both triggering soft off properly, and setting up the device to _wake_ from soft off work as expected.
5959

60-
<Tabs groupId="advanced-methods" defaultValue="direct" className="secrettabs">
60+
<Tabs groupId="advanced-methods" queryString defaultValue="direct" className="secrettabs">
6161
<TabItem value="direct" label="Direct Pin">
6262
<SoftOffBehavior />
6363
</TabItem>
@@ -78,7 +78,12 @@ For this approach, you will need to make sure that the [soft off behavior](../..
7878
Zephyr's basic [GPIO Key](https://docs.zephyrproject.org/3.5.0/build/dts/api/bindings/input/gpio-keys.html) concept is used to configure the soft off GPIO pin.
7979
{/* secrettabs hides this tab selector. GPIO key changes its "orientation" between simple pin and matrix integrated. */}
8080

81-
<Tabs groupId="advanced-methods" defaultValue="direct" className="secrettabs">
81+
<Tabs
82+
groupId="advanced-methods"
83+
queryString
84+
defaultValue="direct"
85+
className="secrettabs"
86+
>
8287
<TabItem value="direct" label="Direct Pin">
8388
<GpioKeyDirect />
8489
</TabItem>
@@ -94,15 +99,25 @@ GPIO keys are defined using child nodes under the `gpio-keys` compatible node. E
9499

95100
- The `gpios` property should be a [phandle-array](https://docs.zephyrproject.org/3.5.0/build/dts/phandles.html#zero-or-more-nodes-with-metadata-phandle-array-type) with a fully defined GPIO pin and with the correct pull up/down and active high/low flags set.
96101

97-
<Tabs groupId="advanced-methods" defaultValue="direct" className="secrettabs">
102+
<Tabs
103+
groupId="advanced-methods"
104+
queryString
105+
defaultValue="direct"
106+
className="secrettabs"
107+
>
98108
<TabItem value="direct" label="Direct Pin">
99109
<SidebandDirect />
100110
</TabItem>
101111
<TabItem value="matrix" label="Matrix Integrated Pin">
102112
<SidebandMatrix />
103113
</TabItem>
104114
<TabItem value="wakeup" label="Wakeup-only Key Switch">
105-
<Tabs groupId="kscan-type" defaultValue="mkscan" className="secrettabs">
115+
<Tabs
116+
groupId="kscan-type"
117+
queryString
118+
defaultValue="mkscan"
119+
className="secrettabs"
120+
>
106121
<TabItem value="dkscan" label="Direct GPIO kscan">
107122
<SidebandWakeupDirect />
108123
</TabItem>
@@ -111,7 +126,7 @@ GPIO keys are defined using child nodes under the `gpio-keys` compatible node. E
111126
</TabItem>
112127
</Tabs>
113128

114-
<Tabs groupId="advanced-methods" defaultValue="direct" className="secrettabs">
129+
<Tabs groupId="advanced-methods" queryString defaultValue="direct" className="secrettabs">
115130
<TabItem value="direct" label="Direct Pin"></TabItem>
116131
<TabItem value="matrix" label="Matrix Integrated Pin">
117132
You also need to update the `zmk,kscan` chosen value to point to the new kscan instance:
@@ -130,7 +145,7 @@ GPIO keys are defined using child nodes under the `gpio-keys` compatible node. E
130145

131146
</TabItem>
132147
<TabItem value="wakeup" label="Wakeup-only Key Switch">
133-
<Tabs groupId="kscan-type" defaultValue="mkscan" className="secrettabs">
148+
<Tabs groupId="kscan-type" queryString defaultValue="mkscan" className="secrettabs">
134149
<TabItem value="dkscan" label="Direct GPIO kscan"></TabItem>
135150
<TabItem value="mkscan" label="Matrix kscan"><SoftOffWaker /></TabItem>
136151
</Tabs>

Diff for: docs/docs/development/local-toolchain/build-flash.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Building a particular keyboard is done using the
2525
command. Its usage slightly changes depending on if your build is for a keyboard
2626
with an onboard MCU or one that uses an MCU board add-on.
2727

28-
<Tabs defaultValue="onboardMcu"
28+
<Tabs queryString="build-opts" defaultValue="onboardMcu"
2929
values={[
3030
{label: 'Onboard MCU', value: 'onboardMcu'},
3131
{label: 'Addon MCU', value: 'addonMcu'}

Diff for: docs/docs/development/local-toolchain/setup/container.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ git clone https://github.com/zmkfirmware/zmk.git
1919
## Installing Development Tools
2020

2121
<Tabs groupId="container"
22+
queryString
2223
defaultValue="vsCode"
2324
values={[
2425
{label: 'VS Code', value: 'vsCode'},
@@ -64,6 +65,7 @@ first make them available by creating volumes.
6465

6566
<Tabs
6667
groupId="container"
68+
queryString
6769
defaultValue="vsCode"
6870
values={[
6971
{ label: "Docker", value: "vsCode" },
@@ -117,6 +119,7 @@ created and mounted. Accordingly, you first have to remove the old ones.
117119

118120
<Tabs
119121
groupId="container"
122+
queryString
120123
defaultValue="vsCode"
121124
values={[
122125
{ label: "Docker", value: "vsCode" },
@@ -153,6 +156,7 @@ created and mounted. Accordingly, you first have to remove the old ones.
153156
## Initialize Container
154157

155158
<Tabs groupId="container"
159+
queryString
156160
defaultValue="vsCode"
157161
values={[
158162
{label: 'VS Code', value: 'vsCode'},

Diff for: docs/docs/development/local-toolchain/setup/native.mdx

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import TabItem from "@theme/TabItem";
99
export const OsTabs = (props) => (
1010
<Tabs
1111
groupId="operating-system"
12+
queryString
1213
defaultValue="ubuntu"
1314
values={[
1415
{ label: "Ubuntu", value: "ubuntu" },
@@ -25,6 +26,7 @@ export const OsTabs = (props) => (
2526
export const OsNoteTabs = (props) => (
2627
<Tabs
2728
groupId="operating-system"
29+
queryString
2830
defaultValue="win"
2931
values={[
3032
{ label: "Windows", value: "win" },
@@ -40,6 +42,7 @@ export const OsNoteTabs = (props) => (
4042
export const EnvTabs = (props) => (
4143
<Tabs
4244
groupId="python-environment"
45+
queryString
4346
defaultValue="venv"
4447
values={[
4548
{ label: "Install within Virtual Environment", value: "venv" },
@@ -55,6 +58,7 @@ export const EnvTabs = (props) => (
5558
export const WinTermTabs = (props) => (
5659
<Tabs
5760
groupId="windows-terminal-choice"
61+
queryString
5862
defaultValue="cmd"
5963
values={[
6064
{ label: "Command Prompt", value: "cmd" },
@@ -100,7 +104,7 @@ These steps are very similar to Zephyr's [Get Zephyr and install Python dependen
100104

101105
<EnvTabs>
102106
<TabItem value="venv">
103-
<Tabs groupId="operating-systems" defaultValue="ubuntu">
107+
<Tabs groupId="operating-systems" queryString defaultValue="ubuntu">
104108
<TabItem value="ubuntu" label="Ubuntu">
105109

106110
1. Use `apt` to install Python `venv` package:
@@ -201,7 +205,7 @@ pip install -r zephyr/scripts/requirements-base.txt
201205

202206
</TabItem>
203207
<TabItem value="glob">
204-
<Tabs groupId="operating-systems" defaultValue="ubuntu">
208+
<Tabs groupId="operating-systems" queryString defaultValue="ubuntu">
205209
<TabItem value="ubuntu" label="Ubuntu">
206210
1. Install `west`:
207211

@@ -282,7 +286,7 @@ This step pulls down quite a bit of tooling, be patient!
282286
west zephyr-export
283287
```
284288

285-
<Tabs groupId="operating-systems" defaultValue="ubuntu" className="secrettabs">
289+
<Tabs groupId="operating-systems" queryString defaultValue="ubuntu" className="secrettabs">
286290
<TabItem value="ubuntu" label="Ubuntu">
287291

288292
4. Install the additional dependencies found in Zephyr's `requirements-base.txt`:

Diff for: docs/docs/development/usb-logging.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ boot, before you can connect to view the logs.
5050
After flashing the updated ZMK image, the board should expose a USB CDC ACM device that you can connect to and view the logs.
5151

5252
<Tabs
53+
queryString="operating-system"
5354
defaultValue="linux"
5455
values={[
5556
{label: 'Linux', value: 'linux'},

Diff for: docs/docs/keymaps/behaviors/hold-tap.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ One workaround is to create a [macro](macros.md) that invokes those behaviors an
162162
### Example Use-Cases
163163

164164
<Tabs
165+
queryString="examples"
165166
defaultValue="homerow_mods"
166167
values={[
167168
{label: 'Homerow Mods', value: 'homerow_mods'},

Diff for: docs/docs/keymaps/behaviors/tap-dance.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The number of bindings in this array also determines the tap-dance's maximum num
2727
### Example Usage
2828

2929
<Tabs
30+
queryString="examples"
3031
defaultValue="basic"
3132
values={[
3233
{label: 'Basic Example: Counter', value: 'basic'},

Diff for: docs/docs/troubleshooting/hardware-issues.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import TabItem from "@theme/TabItem";
1010
export const TesterTabs = (props) => (
1111
<Tabs
1212
groupId="testers"
13+
queryString
1314
defaultValue="promicro"
1415
values={[
1516
{ label: "Pro Micro Compatible Board", value: "promicro" },
@@ -25,6 +26,7 @@ export const TesterTabs = (props) => (
2526
export const PinTabs = (props) => (
2627
<Tabs
2728
groupId="pin-approaches"
29+
queryString
2830
defaultValue="shield"
2931
values={[
3032
{ label: "Tester Shield", value: "shield" },

Diff for: docs/docs/user-setup.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ Before running the setup script, you will first need to create a new GitHub repo
6363
To start the setup process, run the following from your command line prompt:
6464

6565
<Tabs
66+
queryString="command"
6667
defaultValue="curl"
6768
values={[
6869
{label: 'Using curl', value: 'curl'},
6970
{label: 'Using wget', value: 'wget'},
70-
{label: 'Using PowerShell', value: 'PowerShell'},
71+
{label: 'Using PowerShell', value: 'powershell'},
7172
]}>
7273
<TabItem value="curl">
7374

Diff for: docs/src/components/interconnect-tabs.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ function InterconnectTabs({ items, gpio }: InterconnectTabsProps) {
5959
.sort((a, b) => a.id.localeCompare(b.id));
6060

6161
return (
62-
<Tabs defaultValue={"pro_micro"} values={grouped.map(mapInterconnectValue)}>
62+
<Tabs
63+
queryString="interconnect"
64+
defaultValue={"pro_micro"}
65+
values={grouped.map(mapInterconnectValue)}
66+
>
6367
{grouped.map((items) => mapInterconnect(items, gpio))}
6468
</Tabs>
6569
);

0 commit comments

Comments
 (0)