v0.18.0: ZMK modules support and layer key styling
This release adds support for parsing ZMK configs that use modules like zmk-helpers with additional config options, along with adding special styling to layer key legends and making them clickable.
Edit: zmk-helpers now have docs on using keymap-drawer with it using below changes.
Features
Drawing
-
Breaking change: Add new config option
draw_config.style_layer_activatorswhich defaults to true. This marks layer activators legends by adding a link that goes to the corresponding layer (might not work for embedded SVGs), and adding an underline by default.- If you want to restore the old behavior, this setting can be disabled in the config file:
draw_config: { style_layer_activators: false } - You can change the styling, e.g. if you want italic instead of underlined:
draw_config: svg_extra_style: | text.layer-activator { text-decoration: none; font-style: italic }
- If you want to restore the old behavior, this setting can be disabled in the config file:
-
Add a new CSS class
alternateso you can define separate styling for extra activators marked by theparse_config.mark_alternate_layer_activatorsconfig (no styling defined by default) (#98)- Example:
parse_config: mark_alternate_layer_activators: true draw_config: svg_extra_style: | rect.held.alternate { fill: #478583; } @media (prefers-color-scheme: dark) { rect.held.alternate { fill: #478583; } } # some other color here
- Example:
-
Add
hiddenproperty to the combo spec, so you can avoid drawing certain combos that the parser outputs by addinghidden: true(for instance throughparse_config.zmk_combos) (#104)- Example:
parse_config: zmk_combos: combo_esc: { hidden: true }
- Example:
-
Support using underscore instead of space as split separator for the cols+thumbs notation spec in order to reduce command line quoting issues
- Example:
keymap draw -n 33333+2_3+233331 my_asymmetric_keymap.yaml
- Example:
-
Implement support for
layout_aliasesinqmk_keyboardphysical layout definitions
Parsing
- Add
parse_config.zmk_additional_includesto augment the preprocessor include path (#105)- This can be used to be able to parse keymaps using
zmk-helpersusing the module functionality, since#includes aren't using relative paths in that case. Example:parse_config: zmk_additional_includes: [ "zmk-helpers/include" ]
- If you want to use it in the automated ZMK drawing workflow, use the new
west_config_pathargument to the workflow (#107) so that the modules defined in thewest.ymlfile are automatically fetched. (You still need the above value in the config.) Example:jobs: draw: uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main permissions: contents: write # allow workflow to commit to the repo with: [...] west_config_path: 'config' # this folder contains west.yml with module definitions
- Module fetching is not (yet) supported in the ZMK URL parse option of the web app
- This can be used to be able to parse keymaps using
- Add
parse_config.zmk_preambleconfig option which is text inserted at the beginning of the keymap, usually used to modify preprocessor behavior. It defaults to#define KEYMAP_DRAWER(#103)- The default value exposes the existing behavior which was being defined internally before this change
- Restore support for using modified keycodes like
LC(LEFT)inparse_config.*_keycode_mapthat was removed in v0.16 (#106)
Fixes
- More robust devicetree parsing because of a few fixes involving parsing phandle arrays, such as when elements can have commas or split to multiple
<...>, <...>;blocks (#102) - More robust QMK keymap.json parsing, for cases where the keycodes can contain extra spaces
Misc
- Add a physical layout definition for
hummingbirdkeyboard - For unibody keyboards like
fingerpunch/ffkbandrufous, change the default physical layout to avoid all keys being rotated. This should improve readability by sacrificing faithfulness to the actual layout- The older rotated versions are available using
fingerpunch/ffkb_rotatedandrufous_rotated
- The older rotated versions are available using
Full Changelog: v0.17.0...v0.18.0