You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-14Lines changed: 39 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,25 @@ See examples in [the live web demo](https://caksoylar.github.io/keymap-drawer) f
30
30
Compared to to visual editors like [KLE](http://www.keyboard-layout-editor.com/), `keymap-drawer` takes a more programmatic approach.
31
31
It also decouples the physical keyboard layout from the keymap (i.e., layer and combo definitions) and provides the tooling to bootstrap it quickly from existing firmware configuration.
32
32
33
+
## Table of Contents
34
+
35
+
-[Usage](#usage)
36
+
*[Try it as a web application](#try-it-as-a-web-application)
Drawing parameters that are specified in the `draw_config` field can also be overridden in [the keymap YAML](KEYMAP_SPEC.md#draw_config).
156
175
Using this you can preserve your style customizations along with your keymap in a single file.
157
176
158
-
## Custom SVG Glyphs
177
+
## Miscellanea
178
+
179
+
### Custom SVG glyphs
159
180
160
181
`keymap-drawer` can also use SVG glyphs for legends, in addition to plain or unicode text. The easiest way to do this is
161
182
to use the `$$source:id$$` notation [certain `source`s](CONFIGURATION.md#glyph_urls), which will automatically fetch
@@ -198,7 +219,7 @@ layers:
198
219
- ["", "$$vol_up$$", "", "", ""]
199
220
```
200
221
201
-
## Setting up an automated drawing workflow
222
+
### Automated drawing workflow
202
223
203
224
If you use a [ZMK config repo](https://zmk.dev/docs/user-setup), you can set up an automated workflow that parses and draws your keymaps, then commits the YAML parse outputs and produced SVGs to your repo.
204
225
To do that you can add a new workflow to your repo at `.github/workflows/draw-keymaps.yml` that refers to the reusable `keymap-drawer` [workflow](.github/workflows/draw-zmk.yml):
@@ -229,9 +250,10 @@ jobs:
229
250
draw_args: ""# map of extra args to pass to `keymap draw`, e.g. "corne:'-k corne_rotated' cradio:'-k paroxysm'"
230
251
```
231
252
232
-
### Modifying the workflow-generated commit
253
+
#### Modifying the workflow-generated commit
233
254
234
-
The workflow will add the generated SVG and keymap representation YAML files to the `output_folder`, and generate a new commit with commit message "keymap-drawer render" by default. You can modify this commit message with the `commit_message` input param, e.g.:
255
+
The workflow will add the generated SVG and keymap representation YAML files to the `output_folder`, and generate a new commit with commit message "keymap-drawer render" by default.
256
+
You can modify this commit message with the `commit_message` input param, e.g.:
235
257
236
258
```yaml
237
259
jobs:
@@ -243,7 +265,8 @@ jobs:
243
265
# …other inputs
244
266
```
245
267
246
-
Alternatively, you can choose to amend the triggering commit instead of generating a new one by using the `amend_commit: true` option. In this case the triggering commit's message will be used by default, and the `commit_message` input will be ignored. E.g.:
268
+
Alternatively, you can choose to amend the triggering commit instead of generating a new one by using the `amend_commit: true` option.
269
+
In this case the triggering commit's message will be used by default, and the `commit_message` input will be ignored. E.g.:
247
270
248
271
```yaml
249
272
jobs:
@@ -256,7 +279,8 @@ jobs:
256
279
257
280
> #### ⚠️ Rewriting history
258
281
>
259
-
> You should understand the implications of rewriting history if you amend a commit that has already been published. See [remarks](https://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase) in `git-rebase` documentation.
282
+
> You should understand the implications of rewriting history if you amend a commit that has already been published.
283
+
> See [remarks](https://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase) in `git-rebase` documentation.
260
284
261
285
## Community
262
286
@@ -267,6 +291,7 @@ Below are a few tools and example usages from the community that might be inspir
267
291
- [YellowAfterlife's Vial To Keymap Drawer](https://yal-tools.github.io/vial-to-keymap-drawer/): Parser to convert Vial .vil files to keymap YAMLs
268
292
- [jbarr21's `keymap-display`](https://github.com/jbarr21/keymap-display): Uses a [converter script](https://github.com/jbarr21/keymap-display/blob/main/scripts/json2yaml) to convert QMK `keymap.c` to a keymap YAML
269
293
- [hnaderi's fork](https://github.com/hnaderi/keymap-drawer): Contains an example [Dockerfile](https://github.com/hnaderi/keymap-drawer/blob/main/Dockerfile) and publishes unofficial [Docker images](https://github.com/hnaderi/keymap-drawer/blob/main/README.md#using-docker)
294
+
- [mnesarco's `zkeymap`)(https://github.com/mnesarco/zkeymap): Defines a DSL to generate ZMK keymaps, can also output `keymap-drawer` SVGs
270
295
271
296
### Examples
272
297
@@ -281,6 +306,14 @@ Below are a few tools and example usages from the community that might be inspir
281
306
282
307
If you use `keymap-drawer`, tag your Github repo with the [`keymap-drawer` topic](https://github.com/topics/keymap-drawer) and it will show up for anyone else searching for it!
This project requires Python 3.12+ and uses [Poetry](https://python-poetry.org/) for packaging.
@@ -303,11 +336,3 @@ The source code for the Streamlit app lives in the [`keymap-drawer-web`](https:/
303
336
## Questions? Feedback?
304
337
305
338
If you have any questions on usage or feedback for new or existing features, please check out the [Discussions tab](https://github.com/caksoylar/keymap-drawer/discussions) and feel free to create a new one!
Copy file name to clipboardExpand all lines: resources/README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,21 @@ This folder contains resource/"data" files used by `keymap-drawer`. In particula
4
4
5
5
-[`zmk_keyboard_layouts.yaml`](zmk_keyboard_layouts.yaml): Contains a mapping of ZMK keyboard names (the part of the filename `<keyboard>.keymap`) to a mapping
6
6
of `physical-layout` to [physical layout specs](../PHYSICAL_LAYOUTS.md). For example:
Above maps each of the three physical layouts that are defined in the
14
16
[ZMK `planck` config](https://github.com/zmkfirmware/zmk/blob/main/app/boards/arm/planck/planck_rev6.dts) to a corresponding QMK
15
17
keyboard+layout.
16
18
17
19
When `keymap parse` parses a `planck.keymap`, it first searches for a ZMK physical layout (or matrix transform, for backwards compatibility)
18
20
selected under a `chosen` node, e.g.:
21
+
19
22
```dts
20
23
/ {
21
24
chosen {
@@ -27,6 +30,7 @@ This folder contains resource/"data" files used by `keymap-drawer`. In particula
27
30
...
28
31
};
29
32
```
33
+
30
34
Then it outputs the value corresponding to that keyboard/physical layout pair as the physical layout spec: `{zmk_keyboard: planck, layout_name: LAYOUT_ortho_4x12}`.
31
35
If there is no layout selected in the keymap (which is the most frequent scenario), `layout_name` will be omitted.
0 commit comments