Add syntax highlighting to readme's
This commit is contained in:
parent
07fa0e2ee2
commit
37f0f8b408
@ -30,7 +30,8 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It
|
|||||||
|
|
||||||
[WireViz input file](examples/demo01.yml):
|
[WireViz input file](examples/demo01.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1:
|
X1:
|
||||||
type: D-Sub
|
type: D-Sub
|
||||||
subtype: female
|
subtype: female
|
||||||
@ -40,7 +41,7 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It
|
|||||||
subtype: female
|
subtype: female
|
||||||
pinout: [GND, RX, TX]
|
pinout: [GND, RX, TX]
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1:
|
W1:
|
||||||
gauge: 0.25 mm2
|
gauge: 0.25 mm2
|
||||||
length: 0.2
|
length: 0.2
|
||||||
@ -48,7 +49,7 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It
|
|||||||
wirecount: 3
|
wirecount: 3
|
||||||
shield: true
|
shield: true
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
-
|
-
|
||||||
- X1: [5,2,1]
|
- X1: [5,2,1]
|
||||||
- W1: [1,2,3]
|
- W1: [1,2,3]
|
||||||
@ -56,6 +57,7 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It
|
|||||||
-
|
-
|
||||||
- X1: 5
|
- X1: 5
|
||||||
- W1: s
|
- W1: s
|
||||||
|
```
|
||||||
|
|
||||||
Output file:
|
Output file:
|
||||||
|
|
||||||
|
|||||||
@ -33,12 +33,14 @@ if tutorials:
|
|||||||
|
|
||||||
with open(os.path.abspath('../tutorial/tutorial{:02d}.md'.format(i)), 'r') as info:
|
with open(os.path.abspath('../tutorial/tutorial{:02d}.md'.format(i)), 'r') as info:
|
||||||
for line in info:
|
for line in info:
|
||||||
file.write('{}'.format(line))
|
file.write(line)
|
||||||
file.write('\n[Source](tutorial{:02d}.yml):\n\n'.format(i))
|
file.write('\n[Source](tutorial{:02d}.yml):\n\n'.format(i))
|
||||||
|
|
||||||
with open(os.path.abspath('../tutorial/tutorial{:02d}.yml'.format(i)), 'r') as src:
|
with open(os.path.abspath('../tutorial/tutorial{:02d}.yml'.format(i)), 'r') as src:
|
||||||
|
file.write('```yaml\n')
|
||||||
for line in src:
|
for line in src:
|
||||||
file.write(' {}'.format(line))
|
file.write(line)
|
||||||
|
file.write('```\n')
|
||||||
file.write('\n')
|
file.write('\n')
|
||||||
|
|
||||||
file.write('\nOutput:\n\n'.format(i))
|
file.write('\nOutput:\n\n'.format(i))
|
||||||
|
|||||||
@ -6,22 +6,24 @@
|
|||||||
|
|
||||||
[Source](tutorial01.yml):
|
[Source](tutorial01.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1:
|
X1:
|
||||||
pincount: 4
|
pincount: 4
|
||||||
X2:
|
X2:
|
||||||
pincount: 4
|
pincount: 4
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1:
|
W1:
|
||||||
wirecount: 4
|
wirecount: 4
|
||||||
length: 1
|
length: 1
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
-
|
-
|
||||||
- X1: [1-4]
|
- X1: [1-4]
|
||||||
- W1: [1-4]
|
- W1: [1-4]
|
||||||
- X2: [1-4]
|
- X2: [1-4]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
@ -36,7 +38,8 @@ Output:
|
|||||||
|
|
||||||
[Source](tutorial02.yml):
|
[Source](tutorial02.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1:
|
X1:
|
||||||
pincount: 4
|
pincount: 4
|
||||||
# More connector parameters:
|
# More connector parameters:
|
||||||
@ -47,7 +50,7 @@ Output:
|
|||||||
type: Molex KK 254
|
type: Molex KK 254
|
||||||
subtype: female
|
subtype: female
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1:
|
W1:
|
||||||
wirecount: 4
|
wirecount: 4
|
||||||
# more cable parameters:
|
# more cable parameters:
|
||||||
@ -56,12 +59,13 @@ Output:
|
|||||||
show_equiv: true
|
show_equiv: true
|
||||||
colors: [WH, BN, GN, YE]
|
colors: [WH, BN, GN, YE]
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
-
|
-
|
||||||
- X1: [1-4]
|
- X1: [1-4]
|
||||||
- W1: [1-4]
|
- W1: [1-4]
|
||||||
# non-sequential wiring:
|
# non-sequential wiring:
|
||||||
- X2: [1,2,4,3]
|
- X2: [1,2,4,3]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
@ -78,7 +82,8 @@ Output:
|
|||||||
|
|
||||||
[Source](tutorial03.yml):
|
[Source](tutorial03.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1: &template1 # define a template for later use
|
X1: &template1 # define a template for later use
|
||||||
pinout: [GND, VCC, RX, TX] # pincount implicit in pinout
|
pinout: [GND, VCC, RX, TX] # pincount implicit in pinout
|
||||||
type: Molex KK 254
|
type: Molex KK 254
|
||||||
@ -86,7 +91,7 @@ Output:
|
|||||||
X2:
|
X2:
|
||||||
<<: *template1 # reuse template
|
<<: *template1 # reuse template
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1:
|
W1:
|
||||||
wirecount: 4
|
wirecount: 4
|
||||||
length: 1
|
length: 1
|
||||||
@ -95,7 +100,7 @@ Output:
|
|||||||
color_code: DIN # auto-assign colors based on DIN 47100
|
color_code: DIN # auto-assign colors based on DIN 47100
|
||||||
shield: true # add cable shielding
|
shield: true # add cable shielding
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
-
|
-
|
||||||
- X1: [1-4]
|
- X1: [1-4]
|
||||||
- W1: [1-4]
|
- W1: [1-4]
|
||||||
@ -103,6 +108,7 @@ Output:
|
|||||||
- # connect the shielding to a pin
|
- # connect the shielding to a pin
|
||||||
- X1: 1
|
- X1: 1
|
||||||
- W1: s
|
- W1: s
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
@ -117,7 +123,8 @@ Output:
|
|||||||
|
|
||||||
[Source](tutorial04.yml):
|
[Source](tutorial04.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1: &template_con
|
X1: &template_con
|
||||||
pinout: [GND, VCC, SCL, SDA]
|
pinout: [GND, VCC, SCL, SDA]
|
||||||
type: Molex KK 254
|
type: Molex KK 254
|
||||||
@ -132,7 +139,7 @@ Output:
|
|||||||
subtype: female
|
subtype: female
|
||||||
notes: to temperature sensor
|
notes: to temperature sensor
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1: &template_cbl
|
W1: &template_cbl
|
||||||
wirecount: 4
|
wirecount: 4
|
||||||
length: 0.3
|
length: 0.3
|
||||||
@ -142,7 +149,7 @@ Output:
|
|||||||
<<: *template_cbl
|
<<: *template_cbl
|
||||||
length: 0.1
|
length: 0.1
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
-
|
-
|
||||||
- X1: [1-4]
|
- X1: [1-4]
|
||||||
- W1: [1-4]
|
- W1: [1-4]
|
||||||
@ -151,6 +158,7 @@ Output:
|
|||||||
- X2: [1-4]
|
- X2: [1-4]
|
||||||
- W2: [1-4]
|
- W2: [1-4]
|
||||||
- X3: [1-4]
|
- X3: [1-4]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
@ -168,19 +176,20 @@ Output:
|
|||||||
|
|
||||||
[Source](tutorial05.yml):
|
[Source](tutorial05.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1:
|
X1:
|
||||||
pinout: [+12V, GND, GND, +5V]
|
pinout: [+12V, GND, GND, +5V]
|
||||||
type: Molex 8981
|
type: Molex 8981
|
||||||
subtype: female
|
subtype: female
|
||||||
|
|
||||||
ferrules: # ferrules
|
ferrules: # ferrules
|
||||||
F1:
|
F1:
|
||||||
type: Ferrule, crimp
|
type: Ferrule, crimp
|
||||||
subtype: 0.5 mm²
|
subtype: 0.5 mm²
|
||||||
color: OG # optional color
|
color: OG # optional color
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1:
|
W1:
|
||||||
category: bundle # bundle
|
category: bundle # bundle
|
||||||
length: 0.3
|
length: 0.3
|
||||||
@ -188,13 +197,14 @@ Output:
|
|||||||
colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit
|
colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit
|
||||||
notes: hello!
|
notes: hello!
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
- # attach ferrules
|
- # attach ferrules
|
||||||
- F1
|
- F1
|
||||||
- W1: [1-4] # a new ferrule is auto-generated for each wire
|
- W1: [1-4] # a new ferrule is auto-generated for each wire
|
||||||
- # attach connectors (separetely from ferrules)
|
- # attach connectors (separetely from ferrules)
|
||||||
- W1: [1-4]
|
- W1: [1-4]
|
||||||
- X1: [1-4]
|
- X1: [1-4]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
@ -208,7 +218,8 @@ Output:
|
|||||||
|
|
||||||
[Source](tutorial06.yml):
|
[Source](tutorial06.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1:
|
X1:
|
||||||
pinout: [+12V, GND, GND, +5V]
|
pinout: [+12V, GND, GND, +5V]
|
||||||
type: Molex 8981
|
type: Molex 8981
|
||||||
@ -219,20 +230,20 @@ Output:
|
|||||||
subtype: 1.0 mm²
|
subtype: 1.0 mm²
|
||||||
color: YE
|
color: YE
|
||||||
|
|
||||||
ferrules: # ferrules
|
ferrules: # ferrules
|
||||||
F_05:
|
F_05:
|
||||||
type: Ferrule, crimp
|
type: Ferrule, crimp
|
||||||
subtype: 0.5 mm²
|
subtype: 0.5 mm²
|
||||||
color: OG # optional color
|
color: OG # optional color
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1:
|
W1:
|
||||||
category: bundle # budnle
|
category: bundle # budnle
|
||||||
length: 0.3
|
length: 0.3
|
||||||
gauge: 0.5 mm
|
gauge: 0.5 mm
|
||||||
colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit
|
colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
- # attach ferrules
|
- # attach ferrules
|
||||||
- F_05
|
- F_05
|
||||||
- W1: [1,4] # a new ferrule is auto-generated for each wire
|
- W1: [1,4] # a new ferrule is auto-generated for each wire
|
||||||
@ -246,6 +257,7 @@ Output:
|
|||||||
-
|
-
|
||||||
- F_10_1: 1
|
- F_10_1: 1
|
||||||
- W1: 3
|
- W1: 3
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
@ -258,7 +270,8 @@ Output:
|
|||||||
|
|
||||||
[Source](tutorial07.yml):
|
[Source](tutorial07.yml):
|
||||||
|
|
||||||
connectors:
|
```yaml
|
||||||
|
connectors:
|
||||||
X1: &template_con
|
X1: &template_con
|
||||||
type: Molex KK 254
|
type: Molex KK 254
|
||||||
subtype: female
|
subtype: female
|
||||||
@ -274,7 +287,7 @@ Output:
|
|||||||
X6:
|
X6:
|
||||||
<<: *template_con
|
<<: *template_con
|
||||||
|
|
||||||
cables:
|
cables:
|
||||||
W1: &template_wire
|
W1: &template_wire
|
||||||
gauge: 0.25 mm2
|
gauge: 0.25 mm2
|
||||||
length: 0.2
|
length: 0.2
|
||||||
@ -289,7 +302,7 @@ Output:
|
|||||||
W5:
|
W5:
|
||||||
<<: *template_wire
|
<<: *template_wire
|
||||||
|
|
||||||
connections:
|
connections:
|
||||||
-
|
-
|
||||||
- X1: [1-4]
|
- X1: [1-4]
|
||||||
- W1: [1-4]
|
- W1: [1-4]
|
||||||
@ -310,6 +323,7 @@ Output:
|
|||||||
- X5: [1-4]
|
- X5: [1-4]
|
||||||
- W5: [1-4]
|
- W5: [1-4]
|
||||||
- X6: [1-4]
|
- X6: [1-4]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user