Skip to content

Commit

Permalink
doc(readme): add description and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMarble committed Jan 25, 2022
1 parent fd432fc commit 29bb096
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
out
dist
*.png
/*.png
*.keymap
*.json
coverage.txt
Expand Down
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,43 @@

![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)
[![golangci-lint](https://github.com/MrMarble/zmk-layout-viewer/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/MrMarble/zmk-layout-viewer/actions/workflows/golangci-lint.yml)
[![golangci-lint](https://github.com/MrMarble/zmk-layout-viewer/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/MrMarble/zmk-layout-viewer/actions/workflows/golangci-lint.yml)

A **work in progress** Cli tool to generate preview images from a zmk .keymap file.

## Usage

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

Arguments:
<keyboard> Keyboard name to fetch layout.

Flags:
-h, --help Show context-sensitive help.
-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
```
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

```shell
zmk-layout-viewer -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)
Binary file added assets/default_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/layout.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/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/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.
Binary file added assets/tri_layer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 29bb096

Please sign in to comment.