Skip to content

Commit

Permalink
doc: update usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMarble committed Jan 25, 2022
1 parent 37ca158 commit c134303
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ZMK Layout viewer
# ZMK viewer

![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/mrmarble/zmk-layout-viewer)
[![Vuln](https://github.com/MrMarble/zmk-layout-viewer/actions/workflows/vuln.yml/badge.svg)](https://github.com/MrMarble/zmk-layout-viewer/actions/workflows/vuln.yml)
Expand All @@ -9,36 +9,39 @@ A **work in progress** Cli tool to generate preview images from a zmk .keymap fi
## Usage

```shell
Usage: zmk-layout-viewer <keyboard>
Usage: zmk-viewer generate <keyboard-name>

Generate layout image.

Arguments:
<keyboard> Keyboard name to fetch layout.
<keyboard-name> Keyboard name to fetch layout.

Flags:
-h, --help Show context-sensitive help.
-D, --debug Enable debug mode

-f, --file=STRING ZMK .keymap file
-t, --transparent Use a transparent background.
-o, --output="." Output directory.
--debug Enable debug logging.
```

Keyboard name should be the same as in https://config.qmk.fm.

```shell
zmk-layout-viewer cradio
zmk-viewer generate cradio
```
Will output this image:

![](assets/layout.png)

You can pass a .keymap file ([this one for reference](https://github.com/MrMarble/zmk-config/blob/master/config/cradio.keymap)) to generate the layout with bindings
You can pass a .keymap file ([this one for reference](https://github.com/zmkfirmware/zmk/blob/main/app/boards/shields/cradio/cradio.keymap)) to generate the layout with bindings

```shell
zmk-layout-viewer -f ~/zmk-config/config/cradio.keymap cradio
zmk-viewer generate -f ~/zmk-config/config/cradio.keymap cradio
```
will output an image for each layer:

![](assets/default_layer.png)
![](assets/left_layer.png)
![](assets/right_layer.png)
![](assets/tri_layer.png)
![](assets/cradio_default_layer.png)
![](assets/cradio_left_layer.png)
![](assets/cradio_right_layer.png)
![](assets/cradio_tri_layer.png)
File renamed without changes
File renamed without changes
Binary file added assets/cradio_left_layer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cradio_right_layer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file removed assets/left_layer.png
Binary file not shown.
Binary file removed assets/right_layer.png
Binary file not shown.

0 comments on commit c134303

Please sign in to comment.