summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2024-05-30 10:00:28 +0100
committerGitHub <noreply@github.com>2024-05-30 10:00:28 +0100
commitb39285807e1d21300e8a5dbbf6f2c43a8aab3494 (patch)
tree311895a73c967f5d322885c1a9f1073a7b9f1b91 /docs
parent6ef97172889ccd5db376b2a9f8825489e24fdac4 (diff)
[docs] Fix code blocks overflowing page width (#23829)
Fix code blocks overflowing page width
Diffstat (limited to 'docs')
-rw-r--r--docs/cli_commands.md58
-rw-r--r--docs/cli_configuration.md20
-rw-r--r--docs/cli_development.md10
-rw-r--r--docs/cli_tab_complete.md16
-rw-r--r--docs/feature_audio.md38
-rw-r--r--docs/feature_auto_shift.md26
-rw-r--r--docs/feature_layouts.md30
-rw-r--r--docs/feature_macros.md16
-rw-r--r--docs/flashing_bootloadhid.md4
-rw-r--r--docs/hand_wire.md4
-rw-r--r--docs/hardware_keyboard_guidelines.md16
-rw-r--r--docs/how_a_matrix_works.md40
-rw-r--r--docs/keymap.md155
-rw-r--r--docs/newbs_building_firmware.md32
-rw-r--r--docs/newbs_flashing.md12
-rw-r--r--docs/newbs_getting_started.md8
16 files changed, 316 insertions, 169 deletions
diff --git a/docs/cli_commands.md b/docs/cli_commands.md
index 6f82d9c9de..5a85356e70 100644
--- a/docs/cli_commands.md
+++ b/docs/cli_commands.md
@@ -254,15 +254,21 @@ qmk doctor [-y] [-n]
254 254
255Check your environment for problems and prompt to fix them: 255Check your environment for problems and prompt to fix them:
256 256
257 qmk doctor 257```
258qmk doctor
259```
258 260
259Check your environment and automatically fix any problems found: 261Check your environment and automatically fix any problems found:
260 262
261 qmk doctor -y 263```
264qmk doctor -y
265```
262 266
263Check your environment and report problems only: 267Check your environment and report problems only:
264 268
265 qmk doctor -n 269```
270qmk doctor -n
271```
266 272
267## `qmk format-json` 273## `qmk format-json`
268 274
@@ -290,15 +296,21 @@ This command is directory aware. It will automatically fill in KEYBOARD and/or K
290 296
291Show basic information for a keyboard: 297Show basic information for a keyboard:
292 298
293 qmk info -kb planck/rev5 299```
300qmk info -kb planck/rev5
301```
294 302
295Show the matrix for a keyboard: 303Show the matrix for a keyboard:
296 304
297 qmk info -kb ergodox_ez -m 305```
306qmk info -kb ergodox_ez -m
307```
298 308
299Show a JSON keymap for a keyboard: 309Show a JSON keymap for a keyboard:
300 310
301 qmk info -kb clueboard/california -km default 311```
312qmk info -kb clueboard/california -km default
313```
302 314
303## `qmk json2c` 315## `qmk json2c`
304 316
@@ -350,7 +362,9 @@ This command is directory aware. It will automatically fill in KEYBOARD and/or K
350 362
351Do a basic lint check: 363Do a basic lint check:
352 364
353 qmk lint -kb rominronin/katana60/rev2 365```
366qmk lint -kb rominronin/katana60/rev2
367```
354 368
355## `qmk list-keyboards` 369## `qmk list-keyboards`
356 370
@@ -789,16 +803,22 @@ qmk pytest [-t TEST]
789 803
790Run entire test suite: 804Run entire test suite:
791 805
792 qmk pytest 806```
807qmk pytest
808```
793 809
794Run test group: 810Run test group:
795 811
796 qmk pytest -t qmk.tests.test_cli_commands 812```
813qmk pytest -t qmk.tests.test_cli_commands
814```
797 815
798Run single test: 816Run single test:
799 817
800 qmk pytest -t qmk.tests.test_cli_commands.test_c2json 818```
801 qmk pytest -t qmk.tests.test_qmk_path 819qmk pytest -t qmk.tests.test_cli_commands.test_c2json
820qmk pytest -t qmk.tests.test_qmk_path
821```
802 822
803## `qmk painter-convert-graphics` 823## `qmk painter-convert-graphics`
804 824
@@ -835,16 +855,24 @@ options:
835 855
836Run entire test suite: 856Run entire test suite:
837 857
838 qmk test-c 858```
859qmk test-c
860```
839 861
840List available tests: 862List available tests:
841 863
842 qmk test-c --list 864```
865qmk test-c --list
866```
843 867
844Run matching test: 868Run matching test:
845 869
846 qmk test-c --test unicode* 870```
871qmk test-c --test unicode*
872```
847 873
848Run single test: 874Run single test:
849 875
850 qmk test-c --test basic 876```
877qmk test-c --test basic
878```
diff --git a/docs/cli_configuration.md b/docs/cli_configuration.md
index 50f5dc6e28..3d2260c20c 100644
--- a/docs/cli_configuration.md
+++ b/docs/cli_configuration.md
@@ -43,7 +43,9 @@ user.keymap: None -> default
43 43
44The `qmk config` command is used to interact with the underlying configuration. When run with no argument it shows the current configuration. When arguments are supplied they are assumed to be configuration tokens, which are strings containing no spaces with the following form: 44The `qmk config` command is used to interact with the underlying configuration. When run with no argument it shows the current configuration. When arguments are supplied they are assumed to be configuration tokens, which are strings containing no spaces with the following form:
45 45
46 <subcommand|general|default>[.<key>][=<value>] 46```
47<subcommand|general|default>[.<key>][=<value>]
48```
47 49
48## Setting Configuration Values 50## Setting Configuration Values
49 51
@@ -63,19 +65,27 @@ You can read configuration values for the entire configuration, a single key, or
63 65
64### Entire Configuration Example 66### Entire Configuration Example
65 67
66 qmk config 68```
69qmk config
70```
67 71
68### Whole Section Example 72### Whole Section Example
69 73
70 qmk config compile 74```
75qmk config compile
76```
71 77
72### Single Key Example 78### Single Key Example
73 79
74 qmk config compile.keyboard 80```
81qmk config compile.keyboard
82```
75 83
76### Multiple Keys Example 84### Multiple Keys Example
77 85
78 qmk config user compile.keyboard compile.keymap 86```
87qmk config user compile.keyboard compile.keymap
88```
79 89
80## Deleting Configuration Values 90## Deleting Configuration Values
81 91
diff --git a/docs/cli_development.md b/docs/cli_development.md
index e94884de2e..159bca4faa 100644
--- a/docs/cli_development.md
+++ b/docs/cli_development.md
@@ -192,11 +192,15 @@ We use nose2, flake8, and yapf to test, lint, and format code. You can use the `
192 192
193### Testing and Linting 193### Testing and Linting
194 194
195 qmk pytest 195```
196qmk pytest
197```
196 198
197### Formatting 199### Formatting
198 200
199 qmk format-python 201```
202qmk format-python
203```
200 204
201## Formatting Details 205## Formatting Details
202 206
@@ -212,7 +216,9 @@ Our tests can be found in `lib/python/qmk/tests/`. You will find both unit and i
212 216
213If your PR does not include a comprehensive set of tests please add comments like this to your code so that other people know where they can help: 217If your PR does not include a comprehensive set of tests please add comments like this to your code so that other people know where they can help:
214 218
219```python
215 # TODO(unassigned/<your_github_username>): Write <unit|integration> tests 220 # TODO(unassigned/<your_github_username>): Write <unit|integration> tests
221```
216 222
217We use [nose2](https://nose2.readthedocs.io/en/latest/getting_started.html) to run our tests. You can refer to the nose2 documentation for more details on what you can do in your test functions. 223We use [nose2](https://nose2.readthedocs.io/en/latest/getting_started.html) to run our tests. You can refer to the nose2 documentation for more details on what you can do in your test functions.
218 224
diff --git a/docs/cli_tab_complete.md b/docs/cli_tab_complete.md
index 90950b82da..704439c5e1 100644
--- a/docs/cli_tab_complete.md
+++ b/docs/cli_tab_complete.md
@@ -10,22 +10,30 @@ There are several ways you can setup tab completion.
10 10
11Add this to the end of your `.profile` or `.bashrc`: 11Add this to the end of your `.profile` or `.bashrc`:
12 12
13 source ~/qmk_firmware/util/qmk_tab_complete.sh 13```
14source ~/qmk_firmware/util/qmk_tab_complete.sh
15```
14 16
15If you put `qmk_firmware` into another location you will need to adjust this path. 17If you put `qmk_firmware` into another location you will need to adjust this path.
16 18
17Zsh users will need to load `bashcompinit`. The following can be added to `~/.zshrc` file: 19Zsh users will need to load `bashcompinit`. The following can be added to `~/.zshrc` file:
18 20
19 autoload -Uz bashcompinit && bashcompinit 21```
22autoload -Uz bashcompinit && bashcompinit
23```
20 24
21### System Wide Symlink 25### System Wide Symlink
22 26
23If you want the tab completion available to all users of the system you can add a symlink to the `qmk_tab_complete.sh` script: 27If you want the tab completion available to all users of the system you can add a symlink to the `qmk_tab_complete.sh` script:
24 28
25 ln -s ~/qmk_firmware/util/qmk_tab_complete.sh /etc/profile.d/qmk_tab_complete.sh 29```
30ln -s ~/qmk_firmware/util/qmk_tab_complete.sh /etc/profile.d/qmk_tab_complete.sh
31```
26 32
27### System Wide Copy 33### System Wide Copy
28 34
29In some cases a symlink may not work. Instead you can copy the file directly into place. Be aware that updates to the tab complete script may happen from time to time, you will want to recopy the file periodically. 35In some cases a symlink may not work. Instead you can copy the file directly into place. Be aware that updates to the tab complete script may happen from time to time, you will want to recopy the file periodically.
30 36
31 cp util/qmk_tab_complete.sh /etc/profile.d 37```
38cp util/qmk_tab_complete.sh /etc/profile.d
39```
diff --git a/docs/feature_audio.md b/docs/feature_audio.md
index c83d6e3d93..ec28860ae9 100644
--- a/docs/feature_audio.md
+++ b/docs/feature_audio.md
@@ -263,31 +263,39 @@ In music mode, the following keycodes work differently, and don't pass through:
263 263
264The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, add something like this to your `config.h`: 264The pitch standard (`PITCH_STANDARD_A`) is 440.0f by default - to change this, add something like this to your `config.h`:
265 265
266 #define PITCH_STANDARD_A 432.0f 266```c
267#define PITCH_STANDARD_A 432.0f
268```
267 269
268You can completely disable Music Mode as well. This is useful, if you're pressed for space on your controller. To disable it, add this to your `config.h`: 270You can completely disable Music Mode as well. This is useful, if you're pressed for space on your controller. To disable it, add this to your `config.h`:
269 271
270 #define NO_MUSIC_MODE 272```c
273#define NO_MUSIC_MODE
274```
271 275
272### Music Mask 276### Music Mask
273 277
274By default, `MUSIC_MASK` is set to `keycode < 0xFF` which means keycodes less than `0xFF` are turned into notes, and don't output anything. You can change this by defining this in your `config.h` like this: 278By default, `MUSIC_MASK` is set to `keycode < 0xFF` which means keycodes less than `0xFF` are turned into notes, and don't output anything. You can change this by defining this in your `config.h` like this:
275 279
276 #define MUSIC_MASK keycode != KC_NO 280```c
281#define MUSIC_MASK keycode != KC_NO
282```
277 283
278Which will capture all keycodes - be careful, this will get you stuck in music mode until you restart your keyboard! 284Which will capture all keycodes - be careful, this will get you stuck in music mode until you restart your keyboard!
279 285
280For a more advanced way to control which keycodes should still be processed, you can use `music_mask_kb(keycode)` in `<keyboard>.c` and `music_mask_user(keycode)` in your `keymap.c`: 286For a more advanced way to control which keycodes should still be processed, you can use `music_mask_kb(keycode)` in `<keyboard>.c` and `music_mask_user(keycode)` in your `keymap.c`:
281 287
282 bool music_mask_user(uint16_t keycode) { 288```c
283 switch (keycode) { 289 bool music_mask_user(uint16_t keycode) {
284 case RAISE: 290 switch (keycode) {
285 case LOWER: 291 case RAISE:
286 return false; 292 case LOWER:
287 default: 293 return false;
288 return true; 294 default:
289 } 295 return true;
290 } 296 }
297 }
298```
291 299
292Things that return false are not part of the mask, and are always processed. 300Things that return false are not part of the mask, and are always processed.
293 301
@@ -329,8 +337,9 @@ Keycodes available:
329 337
330The feature is disabled by default, to save space. To enable it, add this to your `config.h`: 338The feature is disabled by default, to save space. To enable it, add this to your `config.h`:
331 339
332 #define AUDIO_CLICKY 340```c
333 341#define AUDIO_CLICKY
342```
334 343
335You can configure the default, min and max frequencies, the stepping and built in randomness by defining these values: 344You can configure the default, min and max frequencies, the stepping and built in randomness by defining these values:
336 345
@@ -343,9 +352,6 @@ You can configure the default, min and max frequencies, the stepping and built i
343| `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical, and `1.0f` will make this sound much like the 90's computer screen scrolling/typing effect. | 352| `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical, and `1.0f` will make this sound much like the 90's computer screen scrolling/typing effect. |
344| `AUDIO_CLICKY_DELAY_DURATION` | 1 | An integer note duration where 1 is 1/16th of the tempo, or a sixty-fourth note (see `quantum/audio/musical_notes.h` for implementation details). The main clicky effect will be delayed by this duration. Adjusting this to values around 6-12 will help compensate for loud switches. | 353| `AUDIO_CLICKY_DELAY_DURATION` | 1 | An integer note duration where 1 is 1/16th of the tempo, or a sixty-fourth note (see `quantum/audio/musical_notes.h` for implementation details). The main clicky effect will be delayed by this duration. Adjusting this to values around 6-12 will help compensate for loud switches. |
345 354
346
347
348
349## MIDI Functionality 355## MIDI Functionality
350 356
351See [MIDI](feature_midi) 357See [MIDI](feature_midi)
diff --git a/docs/feature_auto_shift.md b/docs/feature_auto_shift.md
index 3dbaec555e..53635e39f0 100644
--- a/docs/feature_auto_shift.md
+++ b/docs/feature_auto_shift.md
@@ -51,7 +51,9 @@ Yes, unfortunately.
51 51
52Add to your `rules.mk` in the keymap folder: 52Add to your `rules.mk` in the keymap folder:
53 53
54 AUTO_SHIFT_ENABLE = yes 54```
55AUTO_SHIFT_ENABLE = yes
56```
55 57
56If no `rules.mk` exists, you can create one. 58If no `rules.mk` exists, you can create one.
57 59
@@ -372,22 +374,24 @@ completely normal and with no intention of shifted keys.
372 374
373#### An Example Run 375#### An Example Run
374 376
375 hello world. my name is john doe. i am a computer programmer playing with 377```
376 keyboards right now. 378hello world. my name is john doe. i am a computer programmer playing with
379keyboards right now.
377 380
378 [PRESS AS_DOWN quite a few times] 381[PRESS AS_DOWN quite a few times]
379 382
380 heLLo woRLd. mY nAMe is JOHn dOE. i AM A compUTeR proGRaMMER PlAYiNG witH 383heLLo woRLd. mY nAMe is JOHn dOE. i AM A compUTeR proGRaMMER PlAYiNG witH
381 KEYboArDS RiGHT NOw. 384KEYboArDS RiGHT NOw.
382 385
383 [PRESS AS_UP a few times] 386[PRESS AS_UP a few times]
384 387
385 hello world. my name is john Doe. i am a computer programmer playing with 388hello world. my name is john Doe. i am a computer programmer playing with
386 keyboarDs right now. 389keyboarDs right now.
387 390
388 [PRESS AS_RPT] 391[PRESS AS_RPT]
389 392
390 115 393115
394```
391 395
392The keyboard typed `115` which represents your current `AUTO_SHIFT_TIMEOUT` 396The keyboard typed `115` which represents your current `AUTO_SHIFT_TIMEOUT`
393value. You are now set! Practice on the *D* key a little bit that showed up 397value. You are now set! Practice on the *D* key a little bit that showed up
diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md
index 93d040b554..2672477cb5 100644
--- a/docs/feature_layouts.md
+++ b/docs/feature_layouts.md
@@ -37,17 +37,23 @@ New names should try to stick to the standards set by existing layouts, and can
37 37
38For a keyboard to support a layout, the variable must be defined in it's `<keyboard>.h`, and match the number of arguments/keys (and preferably the physical layout): 38For a keyboard to support a layout, the variable must be defined in it's `<keyboard>.h`, and match the number of arguments/keys (and preferably the physical layout):
39 39
40 #define LAYOUT_60_ansi KEYMAP_ANSI 40```c
41#define LAYOUT_60_ansi KEYMAP_ANSI
42```
41 43
42The name of the layout must match this regex: `[a-z0-9_]+` 44The name of the layout must match this regex: `[a-z0-9_]+`
43 45
44The folder name must be added to the keyboard's `rules.mk`: 46The folder name must be added to the keyboard's `rules.mk`:
45 47
46 LAYOUTS = 60_ansi 48```
49LAYOUTS = 60_ansi
50```
47 51
48`LAYOUTS` can be set in any keyboard folder level's `rules.mk`: 52`LAYOUTS` can be set in any keyboard folder level's `rules.mk`:
49 53
50 LAYOUTS = 60_iso 54```
55LAYOUTS = 60_iso
56```
51 57
52but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well. 58but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
53 59
@@ -55,12 +61,16 @@ but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
55 61
56You should be able to build the keyboard keymap with a command in this format: 62You should be able to build the keyboard keymap with a command in this format:
57 63
58 make <keyboard>:<layout> 64```
65make <keyboard>:<layout>
66```
59 67
60### Conflicting layouts 68### Conflicting layouts
61When a keyboard supports multiple layout options, 69When a keyboard supports multiple layout options,
62 70
63 LAYOUTS = ortho_4x4 ortho_4x12 71```
72LAYOUTS = ortho_4x4 ortho_4x12
73```
64 74
65And a layout exists for both options, 75And a layout exists for both options,
66``` 76```
@@ -77,8 +87,10 @@ layouts/
77 87
78The FORCE_LAYOUT argument can be used to specify which layout to build 88The FORCE_LAYOUT argument can be used to specify which layout to build
79 89
80 make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x4 90```
81 make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x12 91make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x4
92make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x12
93```
82 94
83## Tips for Making Layouts Keyboard-Agnostic 95## Tips for Making Layouts Keyboard-Agnostic
84 96
@@ -86,7 +98,9 @@ The FORCE_LAYOUT argument can be used to specify which layout to build
86 98
87Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<folder>.h` should not be included here) file that is being compiled: 99Instead of using `#include "planck.h"`, you can use this line to include whatever `<keyboard>.h` (`<folder>.h` should not be included here) file that is being compiled:
88 100
89 #include QMK_KEYBOARD_H 101```c
102#include QMK_KEYBOARD_H
103```
90 104
91If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement: 105If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement:
92 106
diff --git a/docs/feature_macros.md b/docs/feature_macros.md
index c3162dba80..d5a830c0ef 100644
--- a/docs/feature_macros.md
+++ b/docs/feature_macros.md
@@ -252,11 +252,15 @@ You can send arbitrary keycodes by wrapping them in:
252 252
253For example: 253For example:
254 254
255 SEND_STRING(SS_TAP(X_HOME)); 255```c
256SEND_STRING(SS_TAP(X_HOME));
257```
256 258
257Would tap `KC_HOME` - note how the prefix is now `X_`, and not `KC_`. You can also combine this with other strings, like this: 259Would tap `KC_HOME` - note how the prefix is now `X_`, and not `KC_`. You can also combine this with other strings, like this:
258 260
259 SEND_STRING("VE"SS_TAP(X_HOME)"LO"); 261```c
262SEND_STRING("VE"SS_TAP(X_HOME)"LO");
263```
260 264
261Which would send "VE" followed by a `KC_HOME` tap, and "LO" (spelling "LOVE" if on a newline). 265Which would send "VE" followed by a `KC_HOME` tap, and "LO" (spelling "LOVE" if on a newline).
262 266
@@ -266,7 +270,9 @@ Delays can be also added to the string:
266 270
267For example: 271For example:
268 272
269 SEND_STRING("VE" SS_DELAY(1000) SS_TAP(X_HOME) "LO"); 273```c
274SEND_STRING("VE" SS_DELAY(1000) SS_TAP(X_HOME) "LO");
275```
270 276
271Which would send "VE" followed by a 1-second delay, then a `KC_HOME` tap, and "LO" (spelling "LOVE" if on a newline, but delayed in the middle). 277Which would send "VE" followed by a 1-second delay, then a `KC_HOME` tap, and "LO" (spelling "LOVE" if on a newline, but delayed in the middle).
272 278
@@ -284,7 +290,9 @@ There's also a couple of mod shortcuts you can use:
284These press the respective modifier, send the supplied string and then release the modifier. 290These press the respective modifier, send the supplied string and then release the modifier.
285They can be used like this: 291They can be used like this:
286 292
287 SEND_STRING(SS_LCTL("a")); 293```c
294SEND_STRING(SS_LCTL("a"));
295```
288 296
289Which would send Left Control+`a` (Left Control down, `a`, Left Control up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes. 297Which would send Left Control+`a` (Left Control down, `a`, Left Control up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
290 298
diff --git a/docs/flashing_bootloadhid.md b/docs/flashing_bootloadhid.md
index 6e55a4e7fd..2d1696c6e7 100644
--- a/docs/flashing_bootloadhid.md
+++ b/docs/flashing_bootloadhid.md
@@ -19,7 +19,9 @@ Using the QMK installation script, detailed [here](newbs_getting_started), the r
19 19
20To flash via the command line, use the target `:bootloadhid` by executing the following command: 20To flash via the command line, use the target `:bootloadhid` by executing the following command:
21 21
22 make <keyboard>:<keymap>:bootloadhid 22```
23make <keyboard>:<keymap>:bootloadhid
24```
23 25
24## GUI Flashing 26## GUI Flashing
25 27
diff --git a/docs/hand_wire.md b/docs/hand_wire.md
index 460e8e8be6..0928888f0e 100644
--- a/docs/hand_wire.md
+++ b/docs/hand_wire.md
@@ -181,7 +181,9 @@ Go through the rest of the tabs, assigning keys until you get to the last one wh
181 181
182The source given by Keyboard Firmware Builder is QMK, but is based on a version of QMK from early 2017. To compile the firmware in a modern version of QMK Firmware, you'll need to export via the `Save Configuration` button, then run: 182The source given by Keyboard Firmware Builder is QMK, but is based on a version of QMK from early 2017. To compile the firmware in a modern version of QMK Firmware, you'll need to export via the `Save Configuration` button, then run:
183 183
184 qmk import-kbfirmware /path/to/export.json 184```
185qmk import-kbfirmware /path/to/export.json
186```
185 187
186For example: 188For example:
187 189
diff --git a/docs/hardware_keyboard_guidelines.md b/docs/hardware_keyboard_guidelines.md
index e7c62321f6..728e09c8a9 100644
--- a/docs/hardware_keyboard_guidelines.md
+++ b/docs/hardware_keyboard_guidelines.md
@@ -40,7 +40,9 @@ Valid Examples:
40 40
41QMK uses sub-folders both for organization and to share code between revisions of the same keyboard. You can nest folders up to 4 levels deep: 41QMK uses sub-folders both for organization and to share code between revisions of the same keyboard. You can nest folders up to 4 levels deep:
42 42
43 qmk_firmware/keyboards/top_folder/sub_1/sub_2/sub_3/sub_4 43```
44qmk_firmware/keyboards/top_folder/sub_1/sub_2/sub_3/sub_4
45```
44 46
45If a sub-folder has a `rules.mk` file it will be considered a compilable keyboard. It will be available in QMK Configurator and tested with `make all`. If you are using a folder to organize several keyboards from the same maker you should not have a `rules.mk` file. 47If a sub-folder has a `rules.mk` file it will be considered a compilable keyboard. It will be available in QMK Configurator and tested with `make all`. If you are using a folder to organize several keyboards from the same maker you should not have a `rules.mk` file.
46 48
@@ -250,15 +252,21 @@ When developing your keyboard, keep in mind that all warnings will be treated as
250 252
251If you're adapting your keyboard's setup from another project, but not using the same code, be sure to update the copyright header at the top of the files to show your name, in this format: 253If you're adapting your keyboard's setup from another project, but not using the same code, be sure to update the copyright header at the top of the files to show your name, in this format:
252 254
253 Copyright 2017 Your Name <your@email.com> 255```c
256Copyright 2017 Your Name <your@email.com>
257```
254 258
255If you are modifying someone else's code and have made only trivial changes you should leave their name in the copyright statement. If you have done significant work on the file you should add your name to theirs, like so: 259If you are modifying someone else's code and have made only trivial changes you should leave their name in the copyright statement. If you have done significant work on the file you should add your name to theirs, like so:
256 260
257 Copyright 2017 Their Name <original_author@example.com> Your Name <you@example.com> 261```c
262Copyright 2017 Their Name <original_author@example.com> Your Name <you@example.com>
263```
258 264
259The year should be the first year the file is created. If work was done to that file in later years you can reflect that by appending the second year to the first, like so: 265The year should be the first year the file is created. If work was done to that file in later years you can reflect that by appending the second year to the first, like so:
260 266
261 Copyright 2015-2017 Your Name <you@example.com> 267```c
268Copyright 2015-2017 Your Name <you@example.com>
269```
262 270
263## License 271## License
264 272
diff --git a/docs/how_a_matrix_works.md b/docs/how_a_matrix_works.md
index ebe90eb3de..fdd8c2d76f 100644
--- a/docs/how_a_matrix_works.md
+++ b/docs/how_a_matrix_works.md
@@ -6,6 +6,7 @@ When the circuit is arranged in rows and columns, if a key is pressed, a column
6 6
7The microcontroller will be set up via the firmware to send a logical 1 to the columns, one at a time, and read from the rows, all at once - this process is called matrix scanning. The matrix is a bunch of open switches that, by default, don't allow any current to pass through - the firmware will read this as no keys being pressed. As soon as you press one key down, the logical 1 that was coming from the column the keyswitch is attached to gets passed through the switch and to the corresponding row - check out the following 2x2 example: 7The microcontroller will be set up via the firmware to send a logical 1 to the columns, one at a time, and read from the rows, all at once - this process is called matrix scanning. The matrix is a bunch of open switches that, by default, don't allow any current to pass through - the firmware will read this as no keys being pressed. As soon as you press one key down, the logical 1 that was coming from the column the keyswitch is attached to gets passed through the switch and to the corresponding row - check out the following 2x2 example:
8 8
9```
9 Column 0 being scanned Column 1 being scanned 10 Column 0 being scanned Column 1 being scanned
10 x x 11 x x
11 col0 col1 col0 col1 12 col0 col1 col0 col1
@@ -13,11 +14,13 @@ The microcontroller will be set up via the firmware to send a logical 1 to the c
13 row0 ---(key0)---(key1) row0 ---(key0)---(key1) 14 row0 ---(key0)---(key1) row0 ---(key0)---(key1)
14 | | | | 15 | | | |
15 row1 ---(key2)---(key3) row1 ---(key2)---(key3) 16 row1 ---(key2)---(key3) row1 ---(key2)---(key3)
17```
16 18
17The `x` represents that the column/row associated has a value of 1, or is HIGH. Here, we see that no keys are being pressed, so no rows get an `x`. For one keyswitch, keep in mind that one side of the contacts is connected to its row, and the other, its column. 19The `x` represents that the column/row associated has a value of 1, or is HIGH. Here, we see that no keys are being pressed, so no rows get an `x`. For one keyswitch, keep in mind that one side of the contacts is connected to its row, and the other, its column.
18 20
19When we press `key0`, `col0` gets connected to `row0`, so the values that the firmware receives for that row is `0b01` (the `0b` here means that this is a bit value, meaning all of the following digits are bits - 0 or 1 - and represent the keys in that column). We'll use this notation to show when a keyswitch has been pressed, to show that the column and row are being connected: 21When we press `key0`, `col0` gets connected to `row0`, so the values that the firmware receives for that row is `0b01` (the `0b` here means that this is a bit value, meaning all of the following digits are bits - 0 or 1 - and represent the keys in that column). We'll use this notation to show when a keyswitch has been pressed, to show that the column and row are being connected:
20 22
23```
21 Column 0 being scanned Column 1 being scanned 24 Column 0 being scanned Column 1 being scanned
22 x x 25 x x
23 col0 col1 col0 col1 26 col0 col1 col0 col1
@@ -25,16 +28,20 @@ When we press `key0`, `col0` gets connected to `row0`, so the values that the fi
25 x row0 ---(-+-0)---(key1) row0 ---(-+-0)---(key1) 28 x row0 ---(-+-0)---(key1) row0 ---(-+-0)---(key1)
26 | | | | 29 | | | |
27 row1 ---(key2)---(key3) row1 ---(key2)---(key3) 30 row1 ---(key2)---(key3) row1 ---(key2)---(key3)
31```
28 32
29We can now see that `row0` has an `x`, so has the value of 1. As a whole, the data the firmware receives when `key0` is pressed is: 33We can now see that `row0` has an `x`, so has the value of 1. As a whole, the data the firmware receives when `key0` is pressed is:
30 34
31 col0: 0b01 35```
32 col1: 0b00 36col0: 0b01
33 │└row0 37col1: 0b00
34 └row1 38 │└row0
39 └row1
40```
35 41
36A problem arises when you start pressing more than one key at a time. Looking at our matrix again, it should become pretty obvious: 42A problem arises when you start pressing more than one key at a time. Looking at our matrix again, it should become pretty obvious:
37 43
44```
38 Column 0 being scanned Column 1 being scanned 45 Column 0 being scanned Column 1 being scanned
39 x x 46 x x
40 col0 col1 col0 col1 47 col0 col1 col0 col1
@@ -44,16 +51,20 @@ A problem arises when you start pressing more than one key at a time. Looking at
44 x row1 ---(key2)---(-+-3) x row1 ---(key2)---(-+-3) 51 x row1 ---(key2)---(-+-3) x row1 ---(key2)---(-+-3)
45 52
46 Remember that this ^ is still connected to row1 53 Remember that this ^ is still connected to row1
54```
47 55
48The data we get from that is: 56The data we get from that is:
49 57
50 col0: 0b11 58```
51 col1: 0b11 59col0: 0b11
52 │└row0 60col1: 0b11
53 └row1 61 │└row0
62 └row1
63```
54 64
55Which isn't accurate, since we only have 3 keys pressed down, not all 4. This behavior is called ghosting, and only happens in odd scenarios like this, but can be much more common on a bigger keyboard. The way we can get around this is by placing a diode after the keyswitch, but before it connects to its row. A diode only allows current to pass through one way, which will protect our other columns/rows from being activated in the previous example. We'll represent a dioded matrix like this; 65Which isn't accurate, since we only have 3 keys pressed down, not all 4. This behavior is called ghosting, and only happens in odd scenarios like this, but can be much more common on a bigger keyboard. The way we can get around this is by placing a diode after the keyswitch, but before it connects to its row. A diode only allows current to pass through one way, which will protect our other columns/rows from being activated in the previous example. We'll represent a dioded matrix like this;
56 66
67```
57 Column 0 being scanned Column 1 being scanned 68 Column 0 being scanned Column 1 being scanned
58 x x 69 x x
59 col0 col1 col0 col1 70 col0 col1 col0 col1
@@ -65,11 +76,13 @@ Which isn't accurate, since we only have 3 keys pressed down, not all 4. This be
65 (key2) (key3) (key2) (key3) 76 (key2) (key3) (key2) (key3)
66 ! ! ! ! 77 ! ! ! !
67 row1 ─────┴────────┘ row1 ─────┴────────┘ 78 row1 ─────┴────────┘ row1 ─────┴────────┘
79```
68 80
69In practical applications, the black line of the diode will be placed facing the row, and away from the keyswitch - the `!` in this case is the diode, where the gap represents the black line. A good way to remember this is to think of this symbol: `>|` 81In practical applications, the black line of the diode will be placed facing the row, and away from the keyswitch - the `!` in this case is the diode, where the gap represents the black line. A good way to remember this is to think of this symbol: `>|`
70 82
71Now when we press the three keys, invoking what would be a ghosting scenario: 83Now when we press the three keys, invoking what would be a ghosting scenario:
72 84
85```
73 Column 0 being scanned Column 1 being scanned 86 Column 0 being scanned Column 1 being scanned
74 x x 87 x x
75 col0 col1 col0 col1 88 col0 col1 col0 col1
@@ -81,13 +94,16 @@ Now when we press the three keys, invoking what would be a ghosting scenario:
81 (key2) (┌─┘3) (key2) (┌─┘3) 94 (key2) (┌─┘3) (key2) (┌─┘3)
82 ! ! ! ! 95 ! ! ! !
83 row1 ─────┴────────┘ x row1 ─────┴────────┘ 96 row1 ─────┴────────┘ x row1 ─────┴────────┘
97```
84 98
85Things act as they should! Which will get us the following data: 99Things act as they should! Which will get us the following data:
86 100
87 col0: 0b01 101```
88 col1: 0b11 102col0: 0b01
89 │└row0 103col1: 0b11
90 └row1 104 │└row0
105 └row1
106```
91 107
92The firmware can then use this correct data to detect what it should do, and eventually, what signals it needs to send to the OS. 108The firmware can then use this correct data to detect what it should do, and eventually, what signals it needs to send to the OS.
93 109
diff --git a/docs/keymap.md b/docs/keymap.md
index e371fd9ba5..864d3e14f4 100644
--- a/docs/keymap.md
+++ b/docs/keymap.md
@@ -10,20 +10,21 @@ For trivial key definitions, the higher 8 bits of the **action code** are all 0
10 10
11Respective layers can be validated simultaneously. Layers are indexed with 0 to 31 and higher layer has precedence. 11Respective layers can be validated simultaneously. Layers are indexed with 0 to 31 and higher layer has precedence.
12 12
13 Keymap: 32 Layers Layer: action code matrix 13```
14 ----------------- --------------------- 14Keymap: 32 Layers Layer: action code matrix
15 stack of layers array_of_action_code[row][column] 15----------------- ---------------------
16 ____________ precedence _______________________ 16stack of layers array_of_action_code[row][column]
17 / / | high / ESC / F1 / F2 / F3 .... 17 ____________ precedence _______________________
18 31 /___________// | /-----/-----/-----/----- 18 / / | high / ESC / F1 / F2 / F3 ....
19 30 /___________// | / TAB / Q / W / E .... 19 31 /___________// | /-----/-----/-----/-----
20 29 /___________/ | /-----/-----/-----/----- 20 30 /___________// | / TAB / Q / W / E ....
21 : _:_:_:_:_:__ | : /LCtrl/ A / S / D .... 21 29 /___________/ | /-----/-----/-----/-----
22 : / : : : : : / | : / : : : : 22 : _:_:_:_:_:__ | : /LCtrl/ A / S / D ....
23 2 /___________// | 2 `-------------------------- 23 : / : : : : : / | : / : : : :
24 1 /___________// | 1 `-------------------------- 24 2 /___________// | 2 `--------------------------
25 0 /___________/ V low 0 `-------------------------- 25 1 /___________// | 1 `--------------------------
26 26 0 /___________/ V low 0 `--------------------------
27```
27 28
28Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history. 29Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history.
29 30
@@ -36,50 +37,54 @@ The state of the Keymap layer is determined by two 32 bit parameters:
36 37
37Keymap layer '0' is usually the `default_layer`, with other layers initially off after booting up the firmware, although this can configured differently in `config.h`. It is useful to change `default_layer` when you completely switch a key layout, for example, if you want to switch to Colemak instead of Qwerty. 38Keymap layer '0' is usually the `default_layer`, with other layers initially off after booting up the firmware, although this can configured differently in `config.h`. It is useful to change `default_layer` when you completely switch a key layout, for example, if you want to switch to Colemak instead of Qwerty.
38 39
39 Initial state of Keymap Change base layout 40```
40 ----------------------- ------------------ 41Initial state of Keymap Change base layout
41 42----------------------- ------------------
42 31 31 43
43 30 30 44 31 31
44 29 29 45 30 30
45 : : 46 29 29
46 : : ____________ 47 : :
47 2 ____________ 2 / / 48 : : ____________
48 1 / / ,->1 /___________/ 49 2 ____________ 2 / /
49 ,->0 /___________/ | 0 50 1 / / ,->1 /___________/
50 | | 51,->0 /___________/ | 0
51 `--- default_layer = 0 `--- default_layer = 1 52| |
52 layer_state = 0x00000001 layer_state = 0x00000002 53`--- default_layer = 0 `--- default_layer = 1
54 layer_state = 0x00000001 layer_state = 0x00000002
55```
53 56
54On the other hand, you can change `layer_state` to overlay the base layer with other layers for features such as navigation keys, function keys (F1-F12), media keys, and/or special actions. 57On the other hand, you can change `layer_state` to overlay the base layer with other layers for features such as navigation keys, function keys (F1-F12), media keys, and/or special actions.
55 58
56 Overlay feature layer 59```
57 --------------------- bit|status 60Overlay feature layer
58 ____________ ---+------ 61--------------------- bit|status
59 31 / / 31 | 0 62 ____________ ---+------
60 30 /___________// -----> 30 | 1 63 31 / / 31 | 0
61 29 /___________/ -----> 29 | 1 64 30 /___________// -----> 30 | 1
62 : : | : 65 29 /___________/ -----> 29 | 1
63 : ____________ : | : 66 : : | :
64 2 / / 2 | 0 67 : ____________ : | :
65 ,->1 /___________/ -----> 1 | 1 68 2 / / 2 | 0
66 | 0 0 | 0 69,->1 /___________/ -----> 1 | 1
67 | + 70| 0 0 | 0
68 `--- default_layer = 1 | 71| +
69 layer_state = 0x60000002 <-' 72`--- default_layer = 1 |
70 73 layer_state = 0x60000002 <-'
71 74```
72 75
73### Layer Precedence and Transparency 76### Layer Precedence and Transparency
74Note that ***higher layers have higher priority within the stack of layers***. The firmware works its way down from the highest active layers to look up keycodes. Once the firmware locates a keycode other than `KC_TRNS` (transparent) on an active layer, it stops searching, and lower layers aren't referenced. 77Note that ***higher layers have higher priority within the stack of layers***. The firmware works its way down from the highest active layers to look up keycodes. Once the firmware locates a keycode other than `KC_TRNS` (transparent) on an active layer, it stops searching, and lower layers aren't referenced.
75 78
76 ____________ 79```
77 / / <--- Higher layer 80 ____________
78 / KC_TRNS // 81 / / <--- Higher layer
79 /___________// <--- Lower layer (KC_A) 82 / KC_TRNS //
80 /___________/ 83/___________// <--- Lower layer (KC_A)
81 84/___________/
82 In the above scenario, the non-transparent keys on the higher layer would be usable, but whenever `KC_TRNS` (or equivalent) is defined, the keycode (`KC_A`) on the lower level would be used. 85```
86
87In the above scenario, the non-transparent keys on the higher layer would be usable, but whenever `KC_TRNS` (or equivalent) is defined, the keycode (`KC_A`) on the lower level would be used.
83 88
84**Note:** Valid ways to denote transparency on a given layer: 89**Note:** Valid ways to denote transparency on a given layer:
85* `KC_TRANSPARENT` 90* `KC_TRANSPARENT`
@@ -101,27 +106,29 @@ There are 2 main sections of a `keymap.c` file you'll want to concern yourself w
101 106
102At the top of the file you'll find this: 107At the top of the file you'll find this:
103 108
104 #include QMK_KEYBOARD_H 109```c
105 110#include QMK_KEYBOARD_H
106 // Helpful defines 111
107 #define GRAVE_MODS (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) 112// Helpful defines
108 113#define GRAVE_MODS (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
109 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 114
110 * You can use _______ in place for KC_TRNS (transparent) * 115/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
111 * Or you can use XXXXXXX for KC_NO (NOOP) * 116 * You can use _______ in place for KC_TRNS (transparent) *
112 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 117 * Or you can use XXXXXXX for KC_NO (NOOP) *
113 118 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
114 // Each layer gets a name for readability. 119
115 // The underscores don't mean anything - you can 120// Each layer gets a name for readability.
116 // have a layer called STUFF or any other name. 121// The underscores don't mean anything - you can
117 // Layer names don't all need to be of the same 122// have a layer called STUFF or any other name.
118 // length, and you can also skip them entirely 123// Layer names don't all need to be of the same
119 // and just use numbers. 124// length, and you can also skip them entirely
120 enum layer_names { 125// and just use numbers.
121 _BL, 126enum layer_names {
122 _FL, 127 _BL,
123 _CL, 128 _FL,
124 }; 129 _CL,
130};
131```
125 132
126These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function, and the following `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers. 133These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function, and the following `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers.
127 134
@@ -131,7 +138,9 @@ Note: You may also find some older keymap files may also have a define(s) for `_
131 138
132The main part of this file is the `keymaps[]` definition. This is where you list your layers and the contents of those layers. This part of the file begins with this definition: 139The main part of this file is the `keymaps[]` definition. This is where you list your layers and the contents of those layers. This part of the file begins with this definition:
133 140
134 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 141```c
142const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
143```
135 144
136After this you'll find the layer definitions. Typically you'll have one or more "base layers" (such as QWERTY, Dvorak, or Colemak) and then you'll layer on top of that one or more "function" layers. Due to the way layers are processed you can't overlay a "lower" layer on top of a "higher" layer. 145After this you'll find the layer definitions. Typically you'll have one or more "base layers" (such as QWERTY, Dvorak, or Colemak) and then you'll layer on top of that one or more "function" layers. Due to the way layers are processed you can't overlay a "lower" layer on top of a "higher" layer.
137 146
diff --git a/docs/newbs_building_firmware.md b/docs/newbs_building_firmware.md
index 5e6a4452df..d7c1157b2d 100644
--- a/docs/newbs_building_firmware.md
+++ b/docs/newbs_building_firmware.md
@@ -8,7 +8,9 @@ You can configure your build environment to set the defaults and make working wi
8 8
9Most people new to QMK only have 1 keyboard. You can set this keyboard as your default with the `qmk config` command. For example, to set your default keyboard to `clueboard/66/rev4`: 9Most people new to QMK only have 1 keyboard. You can set this keyboard as your default with the `qmk config` command. For example, to set your default keyboard to `clueboard/66/rev4`:
10 10
11 qmk config user.keyboard=clueboard/66/rev4 11```sh
12qmk config user.keyboard=clueboard/66/rev4
13```
12 14
13::: tip 15::: tip
14The keyboard option is the path relative to the keyboard directory, the above example would be found in `qmk_firmware/keyboards/clueboard/66/rev4`. If you're unsure you can view a full list of supported keyboards with `qmk list-keyboards`. 16The keyboard option is the path relative to the keyboard directory, the above example would be found in `qmk_firmware/keyboards/clueboard/66/rev4`. If you're unsure you can view a full list of supported keyboards with `qmk list-keyboards`.
@@ -16,21 +18,29 @@ The keyboard option is the path relative to the keyboard directory, the above ex
16 18
17You can also set your default keymap name. Most people use their GitHub username like the keymap name from the previous steps: 19You can also set your default keymap name. Most people use their GitHub username like the keymap name from the previous steps:
18 20
19 qmk config user.keymap=<github_username> 21```sh
22qmk config user.keymap=<github_username>
23```
20 24
21## Create a New Keymap 25## Create a New Keymap
22 26
23To create your own keymap you'll want to create a copy of the `default` keymap. If you configured your build environment in the last step you can do that easily with the QMK CLI: 27To create your own keymap you'll want to create a copy of the `default` keymap. If you configured your build environment in the last step you can do that easily with the QMK CLI:
24 28
25 qmk new-keymap 29```sh
30qmk new-keymap
31```
26 32
27If you did not configure your environment, or you have multiple keyboards, you can specify a keyboard name: 33If you did not configure your environment, or you have multiple keyboards, you can specify a keyboard name:
28 34
29 qmk new-keymap -kb <keyboard_name> 35```sh
36qmk new-keymap -kb <keyboard_name>
37```
30 38
31Look at the output from that command, you should see something like this: 39Look at the output from that command, you should see something like this:
32 40
33 Ψ Created a new keymap called <github_username> in: /home/me/qmk_firmware/keyboards/clueboard/66/rev3/keymaps/<github_username>. 41```
42Ψ Created a new keymap called <github_username> in: /home/me/qmk_firmware/keyboards/clueboard/66/rev3/keymaps/<github_username>.
43```
34 44
35This is the location of your new `keymap.c` file. 45This is the location of your new `keymap.c` file.
36 46
@@ -38,7 +48,9 @@ This is the location of your new `keymap.c` file.
38 48
39Open your `keymap.c` file in your text editor. Inside this file you'll find the structure that controls how your keyboard behaves. At the top of `keymap.c` there may be some defines and enums that make the keymap easier to read. Farther down you'll find a line that looks like this: 49Open your `keymap.c` file in your text editor. Inside this file you'll find the structure that controls how your keyboard behaves. At the top of `keymap.c` there may be some defines and enums that make the keymap easier to read. Farther down you'll find a line that looks like this:
40 50
41 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 51```c
52const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
53```
42 54
43This line indicates where the list of Layers begins. Below that you'll find lines containing `LAYOUT`, and these lines indicate the start of a layer. Below that line is the list of keys that comprise a particular layer. 55This line indicates where the list of Layers begins. Below that you'll find lines containing `LAYOUT`, and these lines indicate the start of a layer. Below that line is the list of keys that comprise a particular layer.
44 56
@@ -63,11 +75,15 @@ While you get a feel for how keymaps work, keep each change small. Bigger change
63 75
64When your changes to the keymap are complete you will need to build the firmware. To do so go back to your terminal window and run the compile command: 76When your changes to the keymap are complete you will need to build the firmware. To do so go back to your terminal window and run the compile command:
65 77
66 qmk compile 78```sh
79qmk compile
80```
67 81
68If you did not configure defaults for your environment, or you have multiple keyboards, you can specify a keyboard and/or keymap: 82If you did not configure defaults for your environment, or you have multiple keyboards, you can specify a keyboard and/or keymap:
69 83
70 qmk compile -kb <keyboard> -km <keymap> 84```sh
85qmk compile -kb <keyboard> -km <keymap>
86```
71 87
72While this compiles you will have a lot of output going to the screen informing you of what files are being compiled. It should end with output that looks similar to this: 88While this compiles you will have a lot of output going to the screen informing you of what files are being compiled. It should end with output that looks similar to this:
73 89
diff --git a/docs/newbs_flashing.md b/docs/newbs_flashing.md
index eaa8032961..e9df397267 100644
--- a/docs/newbs_flashing.md
+++ b/docs/newbs_flashing.md
@@ -98,17 +98,23 @@ Click the `Flash` button in QMK Toolbox. You will see output similar to the foll
98 98
99This has been made pretty simple compared to what it used to be. When you are ready to compile and flash your firmware, open up your terminal window and run the flash command: 99This has been made pretty simple compared to what it used to be. When you are ready to compile and flash your firmware, open up your terminal window and run the flash command:
100 100
101 qmk flash 101```sh
102qmk flash
103```
102 104
103If you did not configure your keyboard/keymap name in the CLI according to the [Configure your build environment](newbs_getting_started) section, or you have multiple keyboards, you can specify the keyboard and keymap: 105If you did not configure your keyboard/keymap name in the CLI according to the [Configure your build environment](newbs_getting_started) section, or you have multiple keyboards, you can specify the keyboard and keymap:
104 106
105 qmk flash -kb <my_keyboard> -km <my_keymap> 107```sh
108qmk flash -kb <my_keyboard> -km <my_keymap>
109```
106 110
107This will check the keyboard's configuration, and then attempt to flash it based on the specified bootloader. This means that you don't need to know which bootloader that your keyboard uses. Just run the command, and let the command do the heavy lifting. 111This will check the keyboard's configuration, and then attempt to flash it based on the specified bootloader. This means that you don't need to know which bootloader that your keyboard uses. Just run the command, and let the command do the heavy lifting.
108 112
109However, this does rely on the bootloader being set by the keyboard. If this information is not configured, or you're using a board that doesn't have a supported target to flash it, you will see this error: 113However, this does rely on the bootloader being set by the keyboard. If this information is not configured, or you're using a board that doesn't have a supported target to flash it, you will see this error:
110 114
111 WARNING: This board's bootloader is not specified or is not supported by the ":flash" target at this time. 115```
116WARNING: This board's bootloader is not specified or is not supported by the ":flash" target at this time.
117```
112 118
113In this case, you'll have to fall back on specifying the bootloader. See the [Flashing Firmware](flashing) Guide for more details. 119In this case, you'll have to fall back on specifying the bootloader. See the [Flashing Firmware](flashing) Guide for more details.
114 120
diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md
index 3a901ad7ad..9ebcccc77f 100644
--- a/docs/newbs_getting_started.md
+++ b/docs/newbs_getting_started.md
@@ -196,11 +196,15 @@ If you already know how to use GitHub, [we recommend that you follow these instr
196 196
197Now that your QMK build environment is set up, you can build a firmware for your keyboard. Start by trying to build the keyboard's default keymap. You should be able to do that with a command in this format: 197Now that your QMK build environment is set up, you can build a firmware for your keyboard. Start by trying to build the keyboard's default keymap. You should be able to do that with a command in this format:
198 198
199 qmk compile -kb <keyboard> -km default 199```sh
200qmk compile -kb <keyboard> -km default
201```
200 202
201For example, to build a firmware for a Clueboard 66% you would use: 203For example, to build a firmware for a Clueboard 66% you would use:
202 204
203 qmk compile -kb clueboard/66/rev3 -km default 205```sh
206qmk compile -kb clueboard/66/rev3 -km default
207```
204 208
205::: tip 209::: tip
206The keyboard option is the path relative to the keyboard directory, the above example would be found in `qmk_firmware/keyboards/clueboard/66/rev3`. If you're unsure you can view a full list of supported keyboards with `qmk list-keyboards`. 210The keyboard option is the path relative to the keyboard directory, the above example would be found in `qmk_firmware/keyboards/clueboard/66/rev3`. If you're unsure you can view a full list of supported keyboards with `qmk list-keyboards`.