chore(qmkasciigen): cleanup
parent
2fe80391ee
commit
f1496fb983
12
README.md
12
README.md
|
@ -102,9 +102,21 @@ Interesting
|
||||||
- [Miryoku](https://github.com/manna-harbour/miryoku)
|
- [Miryoku](https://github.com/manna-harbour/miryoku)
|
||||||
- [Toward a more useful keyboard](https://github.com/jasonrudolph/keyboard)
|
- [Toward a more useful keyboard](https://github.com/jasonrudolph/keyboard)
|
||||||
|
|
||||||
|
## qmkasciigen
|
||||||
|
|
||||||
|
Install:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go install github.com/haunt98/qmk_keymaps/cmd/qmkasciigen@latest
|
||||||
|
```
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- [x] How to flash
|
- [x] How to flash
|
||||||
- [x] Add stock firmware/docs
|
- [x] Add stock firmware/docs
|
||||||
- [x] Add qmk lint
|
- [x] Add qmk lint
|
||||||
- [x] Visualize
|
- [x] Visualize
|
||||||
|
- [ ] qmkasciigen
|
||||||
|
- [ ] Use flag
|
||||||
|
- [ ] Add docs
|
||||||
|
- [ ] Get data directly from qmk
|
||||||
|
|
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -46,14 +45,9 @@ var mapSpecialKey = map[string]string{
|
||||||
"RSFT_T(KC_ENT)": "SHIFT ENTER",
|
"RSFT_T(KC_ENT)": "SHIFT ENTER",
|
||||||
}
|
}
|
||||||
|
|
||||||
type DrawConfig struct {
|
|
||||||
Debug bool
|
|
||||||
}
|
|
||||||
|
|
||||||
func Draw(
|
func Draw(
|
||||||
layouts map[string]map[string][]QMKKeyDictionary,
|
layouts map[string]map[string][]QMKKeyDictionary,
|
||||||
keymap QMKKeymap,
|
keymap QMKKeymap,
|
||||||
cfg DrawConfig,
|
|
||||||
) string {
|
) string {
|
||||||
layoutsStr := make([]string, 0, len(layouts))
|
layoutsStr := make([]string, 0, len(layouts))
|
||||||
|
|
||||||
|
@ -165,17 +159,6 @@ func Draw(
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.Debug {
|
|
||||||
s := ""
|
|
||||||
for i := range table {
|
|
||||||
for j := range table[i] {
|
|
||||||
s += table[i][j]
|
|
||||||
}
|
|
||||||
s += "\n"
|
|
||||||
}
|
|
||||||
log.Printf("Table:\n%s\n", s)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print
|
// Print
|
||||||
layerStr := fmt.Sprintf("Layer %d\n", iLayer)
|
layerStr := fmt.Sprintf("Layer %d\n", iLayer)
|
||||||
for i := range table {
|
for i := range table {
|
||||||
|
|
|
@ -54,9 +54,6 @@ func main() {
|
||||||
result := Draw(
|
result := Draw(
|
||||||
qmkInfo.Layouts,
|
qmkInfo.Layouts,
|
||||||
qmkKeymap,
|
qmkKeymap,
|
||||||
DrawConfig{
|
|
||||||
Debug: debug,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
if debug {
|
if debug {
|
||||||
log.Printf("Result:\n%s\n", result)
|
log.Printf("Result:\n%s\n", result)
|
||||||
|
|
Loading…
Reference in New Issue