keymap-drawer icon indicating copy to clipboard operation
keymap-drawer copied to clipboard

Feature request: export layout config for the GitHub action

Open dhruvinsh opened this issue 2 years ago • 3 comments
trafficstars

While using the keymap-drawer action, if the draw_args are provided for type of keyboard or layout as a override, can we please put this details in the keyboard.yaml (keymap yaml) file in the output folder.

      draw_args: "lynx:'-k ferris/sweep -l LAYOUT_split_3x5_2'"

would have output in lynx.yaml config as

layout:
  qmk_keyboard: ferris/sweep
  qmk_layout: LAYOUT_split_3x5_2

This way I can just use the whole config file in the online svg editor.

dhruvinsh avatar Sep 11 '23 03:09 dhruvinsh

It sounds reasonable. While keymap draw augments the internal keymap representation with the command line options it receives, there is no way to export that internal representation afterwards. There can be an additional command line switch to do that.

As an aside, this might also help #8. In that case, if the input YAML doesn't have combo placement hints, keymap draw would automatically determine the best ones. But I wasn't sure how I could expose these back to the user. This might be one way, i.e. output an augmented YAML as a result of the drawing.

caksoylar avatar Sep 11 '23 18:09 caksoylar

Perhaps keymap parse and keymap draw can share the same argument for the layout?

That way we can use parse to feed layout info and update the keymap yaml file, and draw works as is without breaking any functionality, and it does have a check to look at the argument or the config file

If you are okay with this I can send you a pull requests.

dhruvinsh avatar Sep 12 '23 11:09 dhruvinsh

That's true, it can be another solution to override the layout that the parser comes up with. You can make a PR for it -- ideally we would duplicate too much logic for the validation/assignment, but if that will make the PR complicated I might rather refactor it myself in the future.

caksoylar avatar Sep 13 '23 04:09 caksoylar