Skip to content

Commit 4b05de5

Browse files
committed
docs: Document workarounds for locale headers and zmk-helpers
1 parent 8091d53 commit 4b05de5

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,21 @@ It also decouples the physical keyboard layout from the keymap (i.e., layer and
3333
## Table of Contents
3434

3535
- [Usage](#usage)
36-
* [Try it as a web application](#try-it-as-a-web-application)
37-
* [Command-line tool installation](#command-line-tool-installation)
38-
* [Bootstrapping your keymap representation](#bootstrapping-your-keymap-representation)
39-
* [Tweaking the produced keymap representation](#tweaking-the-produced-keymap-representation)
40-
* [Producing the SVG](#producing-the-svg)
36+
- [Try it as a web application](#try-it-as-a-web-application)
37+
- [Command-line tool installation](#command-line-tool-installation)
38+
- [Bootstrapping your keymap representation](#bootstrapping-your-keymap-representation)
39+
- [Tweaking the produced keymap representation](#tweaking-the-produced-keymap-representation)
40+
- [Producing the SVG](#producing-the-svg)
4141
- [Customization](#customization)
4242
- [Miscellanea](#miscellanea)
43-
* [Custom SVG glyphs](#custom-svg-glyphs)
44-
* [Automated drawing workflow](#automated-drawing-workflow)
43+
- [Custom SVG glyphs](#custom-svg-glyphs)
44+
- [Automated drawing workflow](#automated-drawing-workflow)
45+
- [ZMK locale headers](#zmk-locale-headers)
46+
- [Using with zmk-helpers](#using-with-zmk-helpers)
4547
- [Community](#community)
46-
* [Tools](#tools)
47-
* [Examples](#examples)
48-
* [Related projects](#related-projects)
48+
- [Tools](#tools)
49+
- [Examples](#examples)
50+
- [Related projects](#related-projects)
4951
- [Development](#development)
5052
- [Questions? Feedback?](#questions-feedback)
5153

@@ -282,6 +284,36 @@ jobs:
282284
> You should understand the implications of rewriting history if you amend a commit that has already been published.
283285
> See [remarks](https://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase) in `git-rebase` documentation.
284286

287+
### ZMK locale headers
288+
289+
If you use locale headers via [`zmk-locales`](https://github.com/joelspadin/zmk-locales) module or [`zmk-locale-generator`](https://github.com/joelspadin/zmk-locale-generator),
290+
you might want to preserve the keycode names without the locale prefix for `keymap-drawer` to parse.
291+
292+
To do that, follow these two steps:
293+
294+
1. Put the locale header `#include` in a define guard so it isn't processed by `keymap-drawer`:
295+
296+
```c
297+
#ifndef KEYMAP_DRAWER
298+
#include "keys_de.h"
299+
#endif
300+
```
301+
302+
This step should not be necessary if you use `zmk-locales` as a module, like `#include <locale/keys_de.h>`.
303+
304+
2. Remove the locale prefix from the keycodes, so that they can be converted easier using [`zmk_keycode_map`](CONFIGURATION.md#zmk_keycode_map).
305+
This can be done via the `zmk_remove_keycode_prefix` [configuration option](CONFIGURATION.md#zmk_remove_keycode_prefix):
306+
307+
```yaml
308+
parse_config:
309+
zmk_remove_keycode_prefix: ["DE_"]
310+
```
311+
312+
### Using with zmk-helpers
313+
314+
Using [`zmk-helpers`](https://github.com/urob/zmk-helpers) will break the parsing of ZMK keymaps by default.
315+
Check out [this document](https://github.com/urob/zmk-helpers/blob/main/docs/keymap_drawer.md) that describes the configuration setting needed to enable parsing.
316+
285317
## Community
286318

287319
Below are a few tools and example usages from the community that might be inspirational, whether they are doing unique things with styling, configuration or legends used, or integrate `keymap-drawer` into other workflows.

0 commit comments

Comments
 (0)