Go version of keymapviz with a different approach to extracting keymaps.
Command-line is tool to convert qmk_firmware keymap.c to ASCII art.
go install github.com/vunhatchuong/go-keymapviz
Basic usage:
go-keymapviz [-h] [-l LEGENDS] [-t {ascii,fancy}] [-w WRAPPERS] keymap_c
Example:
go-keymapviz -kb sofle -t fancy ./sofle.c
You can check out available keyboards and their ascii templates when running the program without any arguments.
go-keymapviz
The program looks for specific patterns in keymap.c to extract correctly.
Layout zone is the entry point of your keymap, everything around it will be discarded.
It specifically has to end with };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ----
};
Keymap layers are things inside ()
and the closing )
must be on a new line.
It doesn't matter what the name of the layer is or what kind of layout it is.
[_QWERTY] = LAYOUT_ortho_4x12(
// ----
),
The final step is to extract keycodes inside layers, keycodes are defined as any word.
Ex: AU_OFF
is a word, AU OFF
is 2 words.