This release contains two major new features: parsing of modifier functions and dark mode support! It also contains a couple of smaller breaking changes, so make sure to check them out below.
Features
Parsing
- Added support for **parsing modifier functions** like `LC(V)` in ZMK and `LCTL(KC_V)` in QMK, used for sending modified keycodes like <kbd>ctrl</kbd>+<kbd>v</kbd> events with one key press
- By default these will be converted to `Ctl+ V` representation, this is configurable via the new [`parse_config.modifier_fn_map` setting](https://github.com/caksoylar/keymap-drawer/blob/v0.16.0/CONFIGURATION.md#modifier_fn_map)
- You can also assign special names to specific mod combinations, like `Hyper+ X` for `LC(LS(LG(LA(X))))`
- **Breaking change:** If you were using entries like `LC(V): Paste` in `parse_config.zmk_keycode_map` or `C(V): Paste` in `qmk_keycode_map`, they will no longer work because `LC` and `V` parts are processed separately. If you want to preserve the mapping, instead define them in `raw_binding_map` like `&kp LC(V): Paste` for ZMK or `C(KC_V): Paste` for QMK.
- Added parsing for QMK tap-toggle layers `TT(LAYER)` by m-demare in https://github.com/caksoylar/keymap-drawer/pull/87
Drawing
- Added **dark mode support**, by snoyer!
- This is implemented as a special set of [CSS overrides](https://github.com/caksoylar/keymap-drawer/blob/v0.16.0/CONFIGURATION.md#svg_style_dark1) that get added to the final CSS if the new `draw_config.dark_mode` setting is on, or added under `media (prefers-color-scheme: dark)` when set to `"auto"` to fit the web page or OS light/dark setting.
- The default is `false` which means light mode only, so this is not a breaking change for CLI users. The [web app](https://caksoylar.github.io/keymap-drawer/) overrides it to `"auto"`.
| `dark_mode: false` | `dark_mode: true` | `dark_mode: auto` |
| - | - | - |
|  |  |  |
- Added support for **appending footer text** to produced SVGs using [`draw_config.footer_text`](https://github.com/caksoylar/keymap-drawer/blob/v0.16.0/CONFIGURATION.md#footer_text)
- The value goes into a `<text>` element but it isn't escaped, so you can add e.g. links using `<a>` tags
- The default value is empty so this isn't a breaking change for CLI users. The [web app](https://caksoylar.github.io/keymap-drawer/) overrides it to "<text>Created with <a href="https://github.com/caksoylar/keymap-drawer">keymap-drawer</a></text>"
- Added support for **using [Phosphor Icons](https://phosphoricons.com)**, check out how to use them in [the README section](https://github.com/caksoylar/keymap-drawer/blob/v0.16.0/README.md#custom-svg-glyphs)
CLI
- Added `-o`/`--output` parameter to all `keymap` subcommands, to write their output to the given path rather than stdout
- Using these parameters are recommended if you are running the CLI on Windows, since they ensure the outputs are written with `utf-8` encoding rather than the locale-specific one (which can break many things). This release also incorporates a couple fixes that ensure operation in Windows (tested in powershell)
- **Breaking change:** `keymap draw --ortho-layout` no longer supports the `-o` short form since that is taken over by the output parameter
**Full Changelog**: https://github.com/caksoylar/keymap-drawer/compare/v0.15.0...v0.16.0