Skip to content
This repository was archived by the owner on Apr 22, 2019. It is now read-only.

Commit 4191b8d

Browse files
committed
Update cml formatting
1 parent d18346c commit 4191b8d

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

buildcml.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
outfile_txt = infile.split(".")[0] + ".txt"
1212

1313
# file buffers
14-
md_buffer = ""
14+
md_buffer = "# Controller Layouts\n"
1515
txt_buffer = ""
1616

1717
with open(infile, "r") as f:
@@ -21,7 +21,7 @@
2121
for controller in cml:
2222
print(f"Parsing {controller} controller")
2323
# add data to buffers
24-
md_buffer += f"# {controller}\nType: {cml[controller]['Type']}\n\nPort: {cml[controller]['Port']}\n| | |\n| -- | -- |\n"
24+
md_buffer += f"## {controller}\nType: {cml[controller]['Type']}\n\nPort: {cml[controller]['Port']}\n| | |\n| -- | -- |\n"
2525
txt_buffer += f"-- {controller} --\nType: {cml[controller]['Type']}\nPort: {cml[controller]['Port']}\n"
2626

2727
# parse through inputs
@@ -30,14 +30,14 @@
3030
# Skip non iterable items
3131
continue
3232
# add data to buffers
33-
md_buffer += f"| {input_type} | |\n"
33+
md_buffer += f"| {input_type} | -- |\n"
3434
txt_buffer += f" {input_type}:\n"
3535

3636
# parse items
3737
for item in cml[controller][input_type]:
3838
# deal with extra nesting
3939
if type(cml[controller][input_type][item]) == type({}):
40-
md_buffer += f"| {item} | |\n"
40+
md_buffer += f"| {item} | -- |\n"
4141
txt_buffer += f" {item}:\n"
4242
for subitem in cml[controller][input_type][item]:
4343
md_buffer += f"| {subitem} | {cml[controller][input_type][item][subitem]} |\n"

docs/controller_layout.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,71 @@
1-
# Driver
1+
# Controller Layouts
2+
## Driver
23
Type: Xbox Controller
34

45
Port: 0
56
| | |
67
| -- | -- |
7-
| Joysticks | |
8-
| Left | |
8+
| Joysticks | -- |
9+
| Left | -- |
910
| X | Robot steering / rotation |
1011
| Y | |
1112
| Btn | |
12-
| Right | |
13+
| Right | -- |
1314
| X | |
1415
| Y | |
1516
| Btn | |
16-
| Dpad | |
17+
| Dpad | -- |
1718
| Up | |
1819
| Down | |
1920
| Left | |
2021
| Right | |
21-
| Button Pad | |
22+
| Button Pad | -- |
2223
| A | Robot vision alignment (hold) |
2324
| B | |
2425
| X | Flip forward and backward (toggle) |
2526
| Y | |
26-
| Triggers | |
27+
| Triggers | -- |
2728
| Left | Robot backwards |
2829
| Right | Robot forwards |
29-
| Bumpers | |
30+
| Bumpers | -- |
3031
| Left | |
3132
| Right | Slow mode (hold) |
32-
| Other | |
33+
| Other | -- |
3334
| Start | |
3435
| Select | |
3536
| Home | |
36-
# Operator
37+
## Operator
3738
Type: Xbox Controller
3839

3940
Port: 1
4041
| | |
4142
| -- | -- |
42-
| Joysticks | |
43-
| Left | |
43+
| Joysticks | -- |
44+
| Left | -- |
4445
| X | |
4546
| Y | |
4647
| Btn | |
47-
| Right | |
48+
| Right | -- |
4849
| X | |
4950
| Y | |
5051
| Btn | |
51-
| Dpad | |
52+
| Dpad | -- |
5253
| Up | |
5354
| Down | |
5455
| Left | |
5556
| Right | |
56-
| Button Pad | |
57+
| Button Pad | -- |
5758
| A | |
5859
| B | |
5960
| X | |
6061
| Y | |
61-
| Triggers | |
62+
| Triggers | -- |
6263
| Left | |
6364
| Right | |
64-
| Bumpers | |
65+
| Bumpers | -- |
6566
| Left | |
6667
| Right | |
67-
| Other | |
68+
| Other | -- |
6869
| Start | |
6970
| Select | |
7071
| Home | |

0 commit comments

Comments
 (0)