You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-51Lines changed: 59 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,32 @@
1
1
# Pinout Leaf Generator
2
2
3
-
Pinout diagrams for microcontrollers and other PCBs are well known, but it can be hard always comparing the pinout
4
-
diagram with the real PCB, counting pins. One solution is to print out a diagram that has exactly the right size to push
5
-
the pins through the paper and have the labels right next to the actual pin.
3
+
Pinout diagrams for microcontrollers and other PCBs are well known, but it can be hard always comparing the pinout diagram with the real PCB, counting pins. One solution is to print out a diagram that has exactly the right size to push the pins through the paper and have the labels right next to the actual pin.
6
4
7
5
This project is meant for easily creating such pinout leafs.
8
6
9
-
The pins can be described by a simple YAMLbased description and the tool automatically creates the diagram as a SVG.
7
+
The pins can be described by a simple YAML-based description and the tool automatically creates the diagram as an SVG.
10
8
11
9

12
10
13
11
## Features
14
12
15
13
***SVG Output:**
16
14
* Generates clean, scalable SVG diagrams.
17
-
* Default sizes match the real world PCB exactly, just print at 100%
18
-
* Fully self-contained, font and image resources are embedded into the file so it's fully portable
15
+
* Default sizes match the real-world PCB exactly — just print at 100%.
16
+
* Fully self-contained, font and image resources are embedded into the file so it's fully portable.
17
+
19
18
***Configuration:**
20
19
* Define pinouts, board dimensions, labels, and types using simple YAML or JSON files.
21
-
* Custom types allow control over colors and legend labels
20
+
* Custom types allow control over colors and legend labels.
21
+
22
22
***Web Editor:**
23
23
* Real-time preview of the diagram as you edit the configuration.
24
24
* Syntax highlighting for YAML.
25
-
* Download generated SVG diagrams
25
+
* Download generated SVG diagrams.
26
+
26
27
***CLI Tool:**
27
28
* Process multiple configuration files or entire directories to generate SVG diagrams programmatically.
29
+
28
30
***Front & Back Views:**
29
31
* Automatically generates diagrams for both the front and back sides of the PCB.
30
32
@@ -34,17 +36,17 @@ The pins can be described by a simple YAML based description and the tool automa
34
36
35
37
## Limits
36
38
37
-
* Only four rows of pins are supported
38
-
* No weird arbitrary layouts
39
-
* Only standard 0.1inch pin raster supported (might change in the future)
39
+
* Only four rows of pins are supported.
40
+
* No weird arbitrary layouts.
41
+
* Only the standard 0.1-inch pin raster is supported (might change in the future).
40
42
41
43
## Alternatives
42
44
43
-
*[Youtube: Feather Diagrams Walk-Through for Adafruit](https://www.youtube.com/watch?v=ndVs1UvK6AE)- doing it the manual way in Inkscape
44
-
*[GenPinoutSVG](https://github.com/stevenj/GenPinoutSVG)- a Python tool using CSV files as input
45
-
*[Pinion](https://yaqwsx.github.io/Pinion/)- creates pinout diagrams from KiCAD PCB files
46
-
*[PCBDraw](https://github.com/yaqwsx/PcbDraw)- another KiCADbased tool
47
-
*[Integrated Circuit Pinout Diagram Generator](https://github.com/cmfcmf/ic-pinout-diagram-generator)- probably closest to this project, but without an editor
45
+
-[Youtube: Feather Diagrams Walk-Through for Adafruit](https://www.youtube.com/watch?v=ndVs1UvK6AE)— doing it the manual way in Inkscape
46
+
-[GenPinoutSVG](https://github.com/stevenj/GenPinoutSVG)— a Python tool using CSV files as input
47
+
-[Pinion](https://yaqwsx.github.io/Pinion/)— creates pinout diagrams from KiCAD PCB files
48
+
-[PCBDraw](https://github.com/yaqwsx/PcbDraw)— another KiCAD-based tool
49
+
-[Integrated Circuit Pinout Diagram Generator](https://github.com/cmfcmf/ic-pinout-diagram-generator)— probably closest to this project, but without an editor
48
50
49
51
None of the tools above focus on dimensional accuracy and printing. They are more about creating diagrams for documentation or web pages.
50
52
@@ -55,28 +57,31 @@ None of the tools above focus on dimensional accuracy and printing. They are mor
55
57
1. Go to https://splitbrain.github.io/pinoutleaf/
56
58
2. Edit the YAML configuration in the editor.
57
59
3. The SVG diagrams will update automatically.
58
-
4. Click the images to download them
60
+
4. Click the images to download them.
59
61
60
62
Feel free to open an issue when you create a new pinout leaf and we can add it to the list of existing leafs.
61
63
62
64
### Premade Leafs
63
65
64
-
Check the [pinouts](public/pinouts) directory for boards that have already been defined. Open a pull request or ticket if you made one and want it included in the repo.
66
+
Check the [pinouts](https://github.com/splitbrain/pinoutleaf/tree/gh-pages/pinouts) directory for boards that have already been defined.
67
+
68
+
Open a [pull request](https://github.com/splitbrain/pinoutleaf/pulls) or [ticket](https://github.com/splitbrain/pinoutleaf/issues) if you made one and want it included in the repo.
65
69
66
70
### Printing
67
71
68
-
* Download the SVG and open it in a SVG capable tool - your browser is fine.
69
-
* Print and make sure your application or printer driver does not apply and scaling (scale: 100%)
70
-
* Optionally poke holes in the marked pin holes with a needle
71
-
* Push your PCB's pins through the paper, enjoy the labels next to the pins
72
+
* Download the SVG and open it in an SVG-capable tool — your browser is fine.
73
+
* Print and make sure your application or printer driver does not apply any scaling (scale: 100%).
74
+
* Optionally poke holes in the marked pin holes with a needle.
75
+
* Carefully push your PCB's pins through the paper; using a jumper wire can help with that.
76
+
* Enjoy the labels next to the pins.
72
77
73
78
### Command-Line Interface (CLI)
74
79
75
-
1. Clone the repo
80
+
1. Clone the repo.
76
81
2. Install dependencies:
77
-
```bash
78
-
npm install
79
-
```
82
+
```bash
83
+
npm install
84
+
```
80
85
3. Build the project (for web editor and CLI):
81
86
```bash
82
87
node build.js
@@ -85,24 +90,25 @@ npm install
85
90
```bash
86
91
node public/dist/cli.js path/to/your/config.yaml
87
92
```
88
-
4. The tool will generate corresponding `.svg` files (e.g., `config.front.svg`, `config.back.svg`) in the same directory
89
-
as the input files.
93
+
5. The tool will generate corresponding `.svg` files (e.g., `config.front.svg`, `config.back.svg`) in the same directory as the input files.
90
94
91
95
## Configuration Syntax
92
96
93
97
Diagrams are configured using YAML or JSON files. Most things have sensible defaults.
94
98
99
+
Note: only YAML is supported in the web editor.
100
+
95
101
### title
96
102
97
-
Defines the title of the diagram
103
+
Defines the title of the diagram:
98
104
99
105
```yaml
100
106
title: "My PCB"
101
107
```
102
108
103
109
### size
104
110
105
-
The size of the PCB is defined in the number of pins (assuming a standard pin raster of 0.1 inch aka 2.54mm). Everything else is derived from this size. Best put your board on a breadboard and count.
111
+
The size of the PCB is defined in the number of pins (assuming a standard pin raster of 0.1 inch, aka 2.54mm). Everything else is derived from this size. Best to put your board on a breadboard and count.
106
112
107
113
```yaml
108
114
width: 4
@@ -111,32 +117,32 @@ height: 6
111
117
112
118
### pins
113
119
114
-
The tool supports up to four rows of pins: `left`, `right`, `top` and `bottom`. If your board does have a different layout, you're out of luck.
120
+
The tool supports up to four rows of pins: `left`, `right`, `top`, and `bottom`. If your board does have a different layout, you're out of luck.
115
121
116
-
For each row, you define an array of pins. For each pin you define an array of `label:type` strings. You can have empty pins in a row.
122
+
For each row, you define an array of pins. For each pin, you define an array of `label:type` strings. You can have empty pins in a row.
117
123
118
124
```yaml
119
125
pins:
120
126
left:
121
127
- [ "GPIO5:gpio", "A5:analog", "MISO:spi" ]
122
128
- [ "GPIO6:gpio", "MOSI:spi" ]
123
-
-
129
+
-
124
130
- [ "GPIO20:gpio", "RX:uart" ]
125
131
- [ "GPIO21:gpio", "TX:uart" ]
126
132
right:
127
133
-
128
-
-
134
+
-
129
135
- [ "5V:power" ]
130
136
- [ "GND:gnd" ]
131
-
- [ "3V3:power"]
137
+
- [ "3V3:power"]
132
138
```
133
139
134
140
### types
135
141
136
-
Types define the background, text color and legend label for a set of pins. Simply give the type a name, define the properties and then use it by name om the pins definition.
142
+
Types define the background color, text color, and legend label for a set of pins. Simply give the type a name, define the properties, and then use it by name in the `pins` definition.
137
143
138
144
```yaml
139
-
types:
145
+
types:
140
146
mytype:
141
147
label: 'Special Pins'
142
148
bgcolor: '#ff00ff'
@@ -145,21 +151,23 @@ Types define the background, text color and legend label for a set of pins. Simp
145
151
146
152
There are the following predefined types, which you can use without defining them yourself:
147
153
148
-
* `gpio`
149
-
* `power`
150
-
* `gnd`
151
-
* `i2c`
152
-
* `uart`
153
-
* `spi`
154
-
* `analog`
154
+
-`gpio`
155
+
-`power`
156
+
-`gnd`
157
+
-`i2c`
158
+
-`uart`
159
+
-`spi`
160
+
-`analog`
155
161
156
162
### image
157
163
158
-
For nicer diagrams you can define background images (JPEG or PNG only) to use instead of a general green PCB background. You can set a front and back side image separately.
164
+
For nicer diagrams, you can define background images (JPEG or PNG only) to use instead of the general green PCB background.
165
+
166
+
You can set a front and back side image separately. Images can be referenced as local files or as URLs. In both cases, the generator will try to actually embed the image in the generated SVG as a Data URL.
159
167
160
-
Images can be referenced as local file or as URL. In both cases the generator will try to actually embed the image in the generated SVG as a dataurl.
168
+
By default, your image will be stretched to exactly match the size defined by the pins. However, your picture will probably not fit exactly. Using the `left`, `right`, `top`, and `bottom` properties, you can define offsets from the respective edges.
161
169
162
-
By default, your image will be stretched to exactly match the size defined by the pins. However, you picture will probably not fit exactly. Using the `left`, `right`, `top` and `bottom` properties you can define offsets from the respective edges. Negative numbers will move the image edge outwards, postive numbers inwards. The offsets are given in one-hundreds of a millimeter, eg. 100 is 1mm. Best interactively experiment in the web editor until the image fits.
170
+
Negative numbers will move the image edge outward, positive numbers inward. The offsets are given in hundredths of a millimeter, e.g., 100 is 1mm. Best to interactively experiment in the web editor until the image fits.
163
171
164
172
```yaml
165
173
image:
@@ -179,14 +187,14 @@ image:
179
187
180
188
### offsets
181
189
182
-
By default, the pin rows will sit on the edge of the defined board size. Sometimes you might want to define your board's size larger than the actual pin area is. You then can use the offsets setting to move a pi row further in.
190
+
By default, the pin rows will sit on the edges of the defined board size. Sometimes you might want to define your board's size larger than the actual pin area. You can use the offsets setting to move a pin row further in.
183
191
184
-
For example the Raspberry Pi has two rows of Pins all the way to the right edge of a much larger board. In this case you might want to define the overall size of the board but then offset the left row of pins so it moves over nearly to the right edge.
192
+
For example, the Raspberry Pi has two rows of pins all the way to the right edge of a much larger board. In this case, you might want to define the overall size of the board but then offset the left row of pins so it moves over nearly to the right edge.
185
193
186
-
Only use positive integers and be sure to not push your row outside of the size dimensions.
194
+
Only use positive integers and be sure not to push your row outside of the size dimensions.
0 commit comments