CLI: Add 'via2json' subcommand (#16468)
This commit is contained in:
parent
f7a5ec2483
commit
efc9c525b1
5 changed files with 176 additions and 2 deletions
|
@ -146,7 +146,13 @@ class KeymapJSONEncoder(QMKJSONEncoder):
|
|||
if key == 'JSON_NEWLINE':
|
||||
layer.append([])
|
||||
else:
|
||||
layer[-1].append(f'"{key}"')
|
||||
if isinstance(key, dict):
|
||||
# We have a macro
|
||||
|
||||
# TODO: Add proper support for nicely formatting keymap.json macros
|
||||
layer[-1].append(f'{self.encode(key)}')
|
||||
else:
|
||||
layer[-1].append(f'"{key}"')
|
||||
|
||||
layer = [f"{self.indent_str*indent_level}{', '.join(row)}" for row in layer]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue